linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] block: soft limit zone-append sectors as well
@ 2020-10-07 12:35 Johannes Thumshirn
  2020-10-07 14:22 ` Jens Axboe
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Thumshirn @ 2020-10-07 12:35 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-fsdevel, linux-block, Damien Le Moal, Christoph Hellwig,
	Johannes Thumshirn, Martin K . Petersen, Damien Le Moal

Martin rightfully noted that for normal filesystem IO we have soft limits
in place, to prevent them from getting too big and not lead to
unpredictable latencies. For zone append we only have the hardware limit
in place.

Cap the max sectors we submit via zone-append to the maximal number of
sectors if the second limit is lower.

Link: https://lore.kernel.org/linux-btrfs/yq1k0w8g3rw.fsf@ca-mkp.ca.oracle.com
Reported-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
Changes to v1:
- Commit the compile error fix *doh*
- Add reviews

 include/linux/blkdev.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index cf80e61b4c5e..ed52fbf1fa31 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1406,7 +1406,10 @@ static inline unsigned int queue_max_segment_size(const struct request_queue *q)
 
 static inline unsigned int queue_max_zone_append_sectors(const struct request_queue *q)
 {
-	return q->limits.max_zone_append_sectors;
+
+	const struct queue_limits *l = &q->limits;
+
+	return min(l->max_zone_append_sectors, l->max_sectors);
 }
 
 static inline unsigned queue_logical_block_size(const struct request_queue *q)
-- 
2.26.2


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

* Re: [PATCH v2] block: soft limit zone-append sectors as well
  2020-10-07 12:35 [PATCH v2] block: soft limit zone-append sectors as well Johannes Thumshirn
@ 2020-10-07 14:22 ` Jens Axboe
  2020-10-07 14:23   ` Johannes Thumshirn
  0 siblings, 1 reply; 3+ messages in thread
From: Jens Axboe @ 2020-10-07 14:22 UTC (permalink / raw)
  To: Johannes Thumshirn
  Cc: linux-fsdevel, linux-block, Damien Le Moal, Christoph Hellwig,
	Martin K . Petersen

On 10/7/20 6:35 AM, Johannes Thumshirn wrote:
> Martin rightfully noted that for normal filesystem IO we have soft limits
> in place, to prevent them from getting too big and not lead to
> unpredictable latencies. For zone append we only have the hardware limit
> in place.
> 
> Cap the max sectors we submit via zone-append to the maximal number of
> sectors if the second limit is lower.

Applied, thanks.

-- 
Jens Axboe


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

* Re: [PATCH v2] block: soft limit zone-append sectors as well
  2020-10-07 14:22 ` Jens Axboe
@ 2020-10-07 14:23   ` Johannes Thumshirn
  0 siblings, 0 replies; 3+ messages in thread
From: Johannes Thumshirn @ 2020-10-07 14:23 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-fsdevel, linux-block, Damien Le Moal, Christoph Hellwig,
	Martin K . Petersen

On 07/10/2020 16:22, Jens Axboe wrote:
> On 10/7/20 6:35 AM, Johannes Thumshirn wrote:
>> Martin rightfully noted that for normal filesystem IO we have soft limits
>> in place, to prevent them from getting too big and not lead to
>> unpredictable latencies. For zone append we only have the hardware limit
>> in place.
>>
>> Cap the max sectors we submit via zone-append to the maximal number of
>> sectors if the second limit is lower.
> 
> Applied, thanks.
> 

Thanks :)

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

end of thread, other threads:[~2020-10-07 14:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-07 12:35 [PATCH v2] block: soft limit zone-append sectors as well Johannes Thumshirn
2020-10-07 14:22 ` Jens Axboe
2020-10-07 14:23   ` Johannes Thumshirn

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).