Commit 935fcc56 authored by wuzhouhui's avatar wuzhouhui Committed by Mike Snitzer

dm mpath: only flush workqueue when needed

The workqueues are shared by many multipath devices, only flush whole
workqueue when necessary.  Otherwise, we just flush works as needed.
Signed-off-by: default avatarwuzhouhui <wuzhouhui14@mails.ucas.ac.cn>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
parent 2adc5c55
......@@ -1211,6 +1211,7 @@ static void flush_multipath_work(struct multipath *m)
set_bit(MPATHF_PG_INIT_DISABLED, &m->flags);
smp_mb__after_atomic();
if (atomic_read(&m->pg_init_in_progress))
flush_workqueue(kmpath_handlerd);
multipath_wait_for_pg_init_completion(m);
......@@ -1218,7 +1219,8 @@ static void flush_multipath_work(struct multipath *m)
smp_mb__after_atomic();
}
flush_workqueue(kmultipathd);
if (m->queue_mode == DM_TYPE_BIO_BASED)
flush_work(&m->process_queued_bios);
flush_work(&m->trigger_event);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment