[dm-devel] [PATCH 11/19] multipathd: don't check foreign paths every tick
Martin Wilck
mwilck at suse.com
Tue Dec 18 23:19:23 UTC 2018
We don't do this for native paths, so don't do it for
foreigns, either. Instead use max_checkint for foreign
paths, always.
Signed-off-by: Martin Wilck <mwilck at suse.com>
---
multipathd/main.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/multipathd/main.c b/multipathd/main.c
index aac32ac8..c981d437 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -2271,6 +2271,7 @@ checkerloop (void *ap)
unsigned int i;
struct timespec last_time;
struct config *conf;
+ int foreign_tick = 0;
pthread_cleanup_push(rcu_unregister, NULL);
rcu_register_thread();
@@ -2368,7 +2369,15 @@ checkerloop (void *ap)
diff_time.tv_sec);
}
}
- check_foreign();
+
+ if (foreign_tick == 0) {
+ conf = get_multipath_config();
+ foreign_tick = conf->max_checkint;
+ put_multipath_config(conf);
+ }
+ if (--foreign_tick == 0)
+ check_foreign();
+
post_config_state(DAEMON_IDLE);
conf = get_multipath_config();
strict_timing = conf->strict_timing;
--
2.19.2
More information about the dm-devel
mailing list