summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2009-06-02 06:35:44 +0200
committerNeilBrown <neilb@suse.de>2009-06-02 06:35:44 +0200
commitddc7201f965ce3192b8a96f65609fe8279148c2e (patch)
tree4fa150e55e7c90b8c790524da4767119c7bd9cd9
parentMonitor: don't get confused if utime is never set. (diff)
downloadmdadm-ddc7201f965ce3192b8a96f65609fe8279148c2e.tar.xz
mdadm-ddc7201f965ce3192b8a96f65609fe8279148c2e.zip
Monitor: reduce default poll interval if mdstat is pollable.
Since 2.6.16, mdstat responds to select/poll. So in that case, increase the default poll interval to about 15 minutes. This ensures that the background load is insignificant. Signed-off-by: NeilBrown <neilb@suse.de>
-rw-r--r--mdadm.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/mdadm.c b/mdadm.c
index 0478ce96..fee7fd92 100644
--- a/mdadm.c
+++ b/mdadm.c
@@ -1373,6 +1373,13 @@ int main(int argc, char *argv[])
rv = 1;
break;
}
+ if (delay == 0) {
+ if (get_linux_version() > 20616)
+ /* mdstat responds to poll */
+ delay = 1000;
+ else
+ delay = 60;
+ }
rv= Monitor(devlist, mailaddr, program,
delay?delay:60, daemonise, scan, oneshot,
dosyslog, test, pidfile);