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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>
Cc: Hannes Reinecke <hare@xxxxxxx>
Cc: Jun'ichi Nomura <j-nomura@xxxxxxxxxxxxx>
Cc: <stable@xxxxxxxxxxxxxxx>
---
 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);
-- 
2.10.0

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



[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux