[dm-devel] [PATCH] dm-mpath: Only reprocess queued IO after pg initialization finished

Hannes Reinecke hare at suse.de
Sat Oct 1 07:50:22 UTC 2016


On 09/30/2016 05:59 PM, Bart Van Assche wrote:
> At least with dm-mq this patch reduces the number of multipath_busy()
> calls while scsi_dh_activate() is in progress from a few million to
> a few thousand.
> 
> Signed-off-by: Bart Van Assche <bart.vanassche at sandisk.com>
> Cc: Hannes Reinecke <hare at suse.de>
> Cc: Jun'ichi Nomura <j-nomura at ce.jp.nec.com>
> Cc: <stable at vger.kernel.org>
> ---
>  drivers/md/dm-mpath.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
> index dd80af2..dd66653 100644
> --- a/drivers/md/dm-mpath.c
> +++ b/drivers/md/dm-mpath.c
> @@ -343,12 +343,15 @@ static void multipath_init_per_bio_data(struct bio *bio, struct dm_mpath_io **mp
>   * Path selection
>   *-----------------------------------------------*/
>  
> +/* Returns a value > 0 if path group initialization is still in progress. */
>  static int __pg_init_all_paths(struct multipath *m)
>  {
>  	struct pgpath *pgpath;
>  	unsigned long pg_init_delay = 0;
>  
> -	if (atomic_read(&m->pg_init_in_progress) || test_bit(MPATHF_PG_INIT_DISABLED, &m->flags))
> +	if (atomic_read(&m->pg_init_in_progress))
> +		return 1;
> +	if (test_bit(MPATHF_PG_INIT_DISABLED, &m->flags))
>  		return 0;
>  
>  	atomic_inc(&m->pg_init_count);
> 
Good point.

Reviewed-by: Hannes Reinecke <hare at suse.com>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare at suse.de			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)




More information about the dm-devel mailing list