mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: Jens Axboe <jaxboe@fusionio.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Shuichi Ihara <sihara@ddn.com>, Mike Snitzer <snitzer@redhat.com>
Subject: [RFC PATCH] block: change max_segments default to USHRT_MAX
Date: Mon, 28 Nov 2011 17:00:15 -0500	[thread overview]
Message-ID: <1322517615-28530-1-git-send-email-snitzer@redhat.com> (raw)

The reported problem was that a DM multipath device's max_segemnts was
constrained to BLK_MAX_SEGMENTS (128) even though the underlying paths'
max_segments were larger.  For example, SCSI establishes a max_segments
of SCSI_MAX_SG_CHAIN_SEGMENTS (2048).

If blk_set_default_limits() sets a block limit's value that is less than
the possible range of values for that limit, stacked devices will never
properly stack the affected limit via blk_stack_limits() if
min_not_zero() is used.

BLK_MAX_SEGMENTS (128) is not the maximum value that may be established
for the max_segments limit.  Setting max_segments to a default of
USHRT_MAX (65535) allows for proper stacking.  Device drivers use
blk_queue_max_segments() to override this default.

Reported-by: Shuichi Ihara <sihara@ddn.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
---
 block/blk-settings.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

[NOTE: I avoided changing BLK_MAX_SEGMENTS to 2048 or USHRT_MAX but
that may be the more appropriate fix.  Or splitting BLK_MAX_SEGMENTS
to BLK_DEF_MAX_SEGMENTS=2048 and BLK_SAFE_MAX_SEGMENTS=128.]

diff --git a/block/blk-settings.c b/block/blk-settings.c
index fa1eb04..0ec98e0 100644
--- a/block/blk-settings.c
+++ b/block/blk-settings.c
@@ -110,7 +110,7 @@ EXPORT_SYMBOL_GPL(blk_queue_lld_busy);
  */
 void blk_set_default_limits(struct queue_limits *lim)
 {
-	lim->max_segments = BLK_MAX_SEGMENTS;
+	lim->max_segments = USHRT_MAX;
 	lim->max_integrity_segments = 0;
 	lim->seg_boundary_mask = BLK_SEG_BOUNDARY_MASK;
 	lim->max_segment_size = BLK_MAX_SEGMENT_SIZE;
-- 
1.7.4.4


             reply	other threads:[~2011-11-28 22:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-28 22:00 Mike Snitzer [this message]
2011-11-29 17:59 ` Martin K. Petersen
2011-11-29 19:33   ` Mike Snitzer

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=1322517615-28530-1-git-send-email-snitzer@redhat.com \
    --to=snitzer@redhat.com \
    --cc=jaxboe@fusionio.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=sihara@ddn.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

Powered by JetHome