All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block: allow max_discard_segments to be stacked
@ 2018-07-20 18:57 ` Mike Snitzer
  0 siblings, 0 replies; 6+ messages in thread
From: Mike Snitzer @ 2018-07-20 18:57 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, dm-devel, hch

Set max_discard_segments to USHRT_MAX in blk_set_stacking_limits() so
that blk_stack_limits() can stack up this limit for stacked devices.

before:

$ cat /sys/block/nvme0n1/queue/max_discard_segments
256
$ cat /sys/block/dm-0/queue/max_discard_segments
1

after:

$ cat /sys/block/nvme0n1/queue/max_discard_segments
256
$ cat /sys/block/dm-0/queue/max_discard_segments
256

Fixes: 1e739730c5b9e ("block: optionally merge discontiguous discard bios into a single request")
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
---
 block/blk-settings.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/blk-settings.c b/block/blk-settings.c
index d1de71124656..24fff4a3d08a 100644
--- a/block/blk-settings.c
+++ b/block/blk-settings.c
@@ -128,7 +128,7 @@ void blk_set_stacking_limits(struct queue_limits *lim)
 
 	/* Inherit limits from component devices */
 	lim->max_segments = USHRT_MAX;
-	lim->max_discard_segments = 1;
+	lim->max_discard_segments = USHRT_MAX;
 	lim->max_hw_sectors = UINT_MAX;
 	lim->max_segment_size = UINT_MAX;
 	lim->max_sectors = UINT_MAX;
-- 
2.18.0

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

* [PATCH] block: allow max_discard_segments to be stacked
@ 2018-07-20 18:57 ` Mike Snitzer
  0 siblings, 0 replies; 6+ messages in thread
From: Mike Snitzer @ 2018-07-20 18:57 UTC (permalink / raw)
  To: axboe; +Cc: hch, dm-devel, linux-block

Set max_discard_segments to USHRT_MAX in blk_set_stacking_limits() so
that blk_stack_limits() can stack up this limit for stacked devices.

before:

$ cat /sys/block/nvme0n1/queue/max_discard_segments
256
$ cat /sys/block/dm-0/queue/max_discard_segments
1

after:

$ cat /sys/block/nvme0n1/queue/max_discard_segments
256
$ cat /sys/block/dm-0/queue/max_discard_segments
256

Fixes: 1e739730c5b9e ("block: optionally merge discontiguous discard bios into a single request")
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
---
 block/blk-settings.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/blk-settings.c b/block/blk-settings.c
index d1de71124656..24fff4a3d08a 100644
--- a/block/blk-settings.c
+++ b/block/blk-settings.c
@@ -128,7 +128,7 @@ void blk_set_stacking_limits(struct queue_limits *lim)
 
 	/* Inherit limits from component devices */
 	lim->max_segments = USHRT_MAX;
-	lim->max_discard_segments = 1;
+	lim->max_discard_segments = USHRT_MAX;
 	lim->max_hw_sectors = UINT_MAX;
 	lim->max_segment_size = UINT_MAX;
 	lim->max_sectors = UINT_MAX;
-- 
2.18.0

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

* Re: [PATCH] block: allow max_discard_segments to be stacked
  2018-07-20 18:57 ` Mike Snitzer
@ 2018-07-23  7:34   ` Christoph Hellwig
  -1 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2018-07-23  7:34 UTC (permalink / raw)
  To: Mike Snitzer; +Cc: axboe, linux-block, dm-devel, hch

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

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

* Re: [PATCH] block: allow max_discard_segments to be stacked
@ 2018-07-23  7:34   ` Christoph Hellwig
  0 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2018-07-23  7:34 UTC (permalink / raw)
  To: Mike Snitzer; +Cc: axboe, hch, dm-devel, linux-block

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

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

* Re: [PATCH] block: allow max_discard_segments to be stacked
  2018-07-20 18:57 ` Mike Snitzer
@ 2018-07-24 20:47   ` Jens Axboe
  -1 siblings, 0 replies; 6+ messages in thread
From: Jens Axboe @ 2018-07-24 20:47 UTC (permalink / raw)
  To: Mike Snitzer; +Cc: linux-block, dm-devel, hch

On 7/20/18 11:57 AM, Mike Snitzer wrote:
> Set max_discard_segments to USHRT_MAX in blk_set_stacking_limits() so
> that blk_stack_limits() can stack up this limit for stacked devices.
> 
> before:
> 
> $ cat /sys/block/nvme0n1/queue/max_discard_segments
> 256
> $ cat /sys/block/dm-0/queue/max_discard_segments
> 1
> 
> after:
> 
> $ cat /sys/block/nvme0n1/queue/max_discard_segments
> 256
> $ cat /sys/block/dm-0/queue/max_discard_segments
> 256

Applied, thanks Mike.

-- 
Jens Axboe

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

* Re: [PATCH] block: allow max_discard_segments to be stacked
@ 2018-07-24 20:47   ` Jens Axboe
  0 siblings, 0 replies; 6+ messages in thread
From: Jens Axboe @ 2018-07-24 20:47 UTC (permalink / raw)
  To: Mike Snitzer; +Cc: hch, dm-devel, linux-block

On 7/20/18 11:57 AM, Mike Snitzer wrote:
> Set max_discard_segments to USHRT_MAX in blk_set_stacking_limits() so
> that blk_stack_limits() can stack up this limit for stacked devices.
> 
> before:
> 
> $ cat /sys/block/nvme0n1/queue/max_discard_segments
> 256
> $ cat /sys/block/dm-0/queue/max_discard_segments
> 1
> 
> after:
> 
> $ cat /sys/block/nvme0n1/queue/max_discard_segments
> 256
> $ cat /sys/block/dm-0/queue/max_discard_segments
> 256

Applied, thanks Mike.

-- 
Jens Axboe

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

end of thread, other threads:[~2018-07-24 20:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-20 18:57 [PATCH] block: allow max_discard_segments to be stacked Mike Snitzer
2018-07-20 18:57 ` Mike Snitzer
2018-07-23  7:34 ` Christoph Hellwig
2018-07-23  7:34   ` Christoph Hellwig
2018-07-24 20:47 ` Jens Axboe
2018-07-24 20:47   ` 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.