dm-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@redhat.com>
To: "Chauhan, Vijay" <Vijay.Chauhan@netapp.com>
Cc: "dm-devel@redhat.com" <dm-devel@redhat.com>,
	"Moger, Babu" <Babu.Moger@netapp.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	"Stankey, Robert" <Robert.Stankey@netapp.com>,
	axboe@kernel.dk, linux-kernel@vger.kernel.org
Subject: [PATCH v2] block: do not artificially constrain max_sectors for stacking drivers
Date: Mon, 9 Jul 2012 10:57:12 -0400	[thread overview]
Message-ID: <20120709145711.GB30886@redhat.com> (raw)
In-Reply-To: <20120709141416.GB30633@redhat.com>

blk_set_stacking_limits() is intended to allow stacking drivers to build
up the limits of the stacked device based on the underlying devices'
limits.  But in the case of 'max_sectors' the default of
BLK_DEF_MAX_SECTORS (1024) doesn't allow the stacking driver to inherit
a max_sectors larger than 1024.

It is now clear that this artificial limit is getting in the way so
change blk_set_stacking_limits's max_sectors to UINT_MAX (which allows
stacking drivers like dm-multipath to inherit 'max_sectors' from the
underlying paths).

blk_limits_max_hw_sectors() must allow stacking drivers to not have
max_sectors set to BLK_DEF_MAX_SECTORS as a side-effect.  Move that
historic constraint to blk_queue_max_hw_sectors().

Reported-by: Vijay Chauhan <vijay.chauhan@netapp.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
---
 block/blk-settings.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

v2: tweak blk_limits_max_hw_sectors and blk_queue_max_hw_sectors

diff --git a/block/blk-settings.c b/block/blk-settings.c
index d3234fc..b808dfd 100644
--- a/block/blk-settings.c
+++ b/block/blk-settings.c
@@ -143,8 +143,7 @@ void blk_set_stacking_limits(struct queue_limits *lim)
 	lim->discard_zeroes_data = 1;
 	lim->max_segments = USHRT_MAX;
 	lim->max_hw_sectors = UINT_MAX;
-
-	lim->max_sectors = BLK_DEF_MAX_SECTORS;
+	lim->max_sectors = UINT_MAX;
 }
 EXPORT_SYMBOL(blk_set_stacking_limits);
 
@@ -255,8 +254,7 @@ void blk_limits_max_hw_sectors(struct queue_limits *limits, unsigned int max_hw_
 	}
 
 	limits->max_hw_sectors = max_hw_sectors;
-	limits->max_sectors = min_t(unsigned int, max_hw_sectors,
-				    BLK_DEF_MAX_SECTORS);
+	limits->max_sectors = min_not_zero(limits->max_sectors, max_hw_sectors);
 }
 EXPORT_SYMBOL(blk_limits_max_hw_sectors);
 
@@ -271,6 +269,8 @@ EXPORT_SYMBOL(blk_limits_max_hw_sectors);
 void blk_queue_max_hw_sectors(struct request_queue *q, unsigned int max_hw_sectors)
 {
 	blk_limits_max_hw_sectors(&q->limits, max_hw_sectors);
+	q->limits.max_sectors = min_t(unsigned int, max_hw_sectors,
+				      BLK_DEF_MAX_SECTORS);
 }
 EXPORT_SYMBOL(blk_queue_max_hw_sectors);
 

  reply	other threads:[~2012-07-09 14:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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         ` Mike Snitzer [this message]
2012-07-09 22:57           ` [PATCH v2] " 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120709145711.GB30886@redhat.com \
    --to=snitzer@redhat.com \
    --cc=Babu.Moger@netapp.com \
    --cc=Robert.Stankey@netapp.com \
    --cc=Vijay.Chauhan@netapp.com \
    --cc=axboe@kernel.dk \
    --cc=dm-devel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).