diff mbox

[RFC] multipath: flush workqueue only in necessary

Message ID 6e0de469.6172.1621928673a.Coremail.wuzhouhui14@mails.ucas.ac.cn (mailing list archive)
State Not Applicable, archived
Delegated to: christophe varoqui
Headers show

Commit Message

wuzhouhui March 12, 2018, 7:41 a.m. UTC
When flush works belong a specific multipath, we flush workqueue only
in necessary.

(That's my first time to send a patch, please remind me if anything
wrong)


--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel

Comments

Changwei Ge March 22, 2018, 8:02 a.m. UTC | #1
Hi Zhouhui,

Your patch is not a formatted one.
At least, it should include Signed-off-by

Thanks,
Changwei

On 2018/3/12 15:47, wuzhouhui wrote:
> When flush works belong a specific multipath, we flush workqueue only
> in necessary.
> 
> (That's my first time to send a patch, please remind me if anything
> wrong)
> 
> diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
> index f7810cc..0f14732 100644
> --- a/drivers/md/dm-mpath.c
> +++ b/drivers/md/dm-mpath.c
> @@ -1154,9 +1154,10 @@ static void flush_multipath_work(struct multipath *m)
>   	set_bit(MPATHF_PG_INIT_DISABLED, &m->flags);
>   	smp_mb__after_atomic();
>   
> -	flush_workqueue(kmpath_handlerd);
> +	if (atomic_read(&m->pg_init_in_progress))
> +		flush_workqueue(kmpath_handlerd);
>   	multipath_wait_for_pg_init_completion(m);
> -	flush_workqueue(kmultipathd);
> +	flush_work(&m->process_queued_bios);
>   	flush_work(&m->trigger_event);
>   
>   	clear_bit(MPATHF_PG_INIT_DISABLED, &m->flags);
> 
> --
> dm-devel mailing list
> dm-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/dm-devel
> 

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
diff mbox

Patch

diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index f7810cc..0f14732 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -1154,9 +1154,10 @@  static void flush_multipath_work(struct multipath *m)
 	set_bit(MPATHF_PG_INIT_DISABLED, &m->flags);
 	smp_mb__after_atomic();
 
-	flush_workqueue(kmpath_handlerd);
+	if (atomic_read(&m->pg_init_in_progress))
+		flush_workqueue(kmpath_handlerd);
 	multipath_wait_for_pg_init_completion(m);
-	flush_workqueue(kmultipathd);
+	flush_work(&m->process_queued_bios);
 	flush_work(&m->trigger_event);
 
 	clear_bit(MPATHF_PG_INIT_DISABLED, &m->flags);