All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] DM MULTIPATH: Allow dm to send larger request if underlying device set to larger max_sectors value
@ 2012-07-08 17:59 Chauhan, Vijay
  2012-07-09  1:01 ` Alasdair G Kergon
  2012-07-09 13:00 ` Mike Snitzer
  0 siblings, 2 replies; 13+ messages in thread
From: Chauhan, Vijay @ 2012-07-08 17:59 UTC (permalink / raw)
  To: dm-devel; +Cc: Moger, Babu, Stankey, Robert

Even though underlying paths are set with larger value for max_sectors, dm 
sets 1024(i.e 512KB) for max_sectors as default. max_sectors for dm 
device can be reset through sysfs but any time map is updated, max_sectors
is again set back to default. This patch gets the minimum of max_sectors from 
physical paths and sets it to dm device.


Signed-off-by: Vijay Chauhan <vijay.chauhan@netapp.com>
Reviewed-by: Babu Moger <babu.moger@netapp.com>
Reviewed-by: Bob Stankey <Robert.Stankey@netapp.com>

---
--- linux-3.5-rc5-orig/drivers/md/dm-table.c	2012-07-07 11:39:17.000000000 +0530
+++ linux-3.5-rc5/drivers/md/dm-table.c	2012-07-09 00:52:37.000000000 +0530
@@ -549,6 +549,18 @@ int dm_set_device_limits(struct dm_targe
 }
 EXPORT_SYMBOL_GPL(dm_set_device_limits);
 
+int dm_device_max_sectors(struct dm_target *ti, struct dm_dev *dev,
+			sector_t start, sector_t len, void *data)
+{
+	unsigned int *max_sectors = data;
+	struct block_device *bdev = dev->bdev;
+	struct request_queue *q = bdev_get_queue(bdev);
+
+	*max_sectors = min_not_zero(*max_sectors, q->limits.max_sectors);
+
+	return 0;
+}
+
 /*
  * Decrement a device's use count and remove it if necessary.
  */
@@ -692,6 +704,7 @@ static int validate_hardware_logical_blo
 	struct dm_target *uninitialized_var(ti);
 	struct queue_limits ti_limits;
 	unsigned i = 0;
+	unsigned int max_sectors = 0;
 
 	/*
 	 * Check each entry in the table in turn.
@@ -706,6 +719,15 @@ static int validate_hardware_logical_blo
 			ti->type->iterate_devices(ti, dm_set_device_limits,
 						  &ti_limits);
 
+		/* Find minimum of max_sectors from target devices */
+		if (ti->type->iterate_devices) {
+			ti->type->iterate_devices(ti, dm_device_max_sectors,
+						  &max_sectors);
+			limits->max_sectors = min_t(unsigned int,
+						    ti_limits.max_hw_sectors,
+						    max_sectors);
+		}
+
 		/*
 		 * If the remaining sectors fall entirely within this
 		 * table entry are they compatible with its logical_block_size?
--

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2012-08-01  8:45 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-08 17:59 [PATCH] DM MULTIPATH: Allow dm to send larger request if underlying device set to larger max_sectors value Chauhan, Vijay
2012-07-09  1:01 ` Alasdair G Kergon
2012-07-09 12:34   ` Chauhan, Vijay
2012-07-09 13:00 ` Mike Snitzer
2012-07-09 13:16   ` Mike Snitzer
2012-07-09 13:40     ` Mike Snitzer
2012-07-09 14:14       ` [PATCH] block: do not artificially constrain max_sectors for stacking drivers Mike Snitzer
2012-07-09 14:57         ` [PATCH v2] " Mike Snitzer
2012-07-09 22:57           ` Mike Snitzer
2012-07-10 19:10             ` Chauhan, Vijay
2012-07-10 19:18               ` Mike Snitzer
2012-08-01  0:39                 ` [RESEND PATCH] " Mike Snitzer
2012-08-01  8:45                   ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.