multipathd: don't check foreign paths every tick
authorMartin Wilck <mwilck@suse.com>
Sun, 23 Dec 2018 22:21:17 +0000 (23:21 +0100)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Mon, 7 Jan 2019 10:46:31 +0000 (11:46 +0100)
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@suse.com>
multipathd/main.c

index aac32ac..c981d43 100644 (file)
@@ -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;