[PATCH v2] block: soft limit zone-append sectors as well

Subsystems: block layer, the rest

STALE2197d REVIEWED: 2 (0M)

2 review trailers.

3 messages, 2 authors, 2020-10-07 · open the first message on its own page

[PATCH v2] block: soft limit zone-append sectors as well

From: Johannes Thumshirn <hidden>
Date: 2020-10-07 12:35:19

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 <redacted>
Reviewed-by: Damien Le Moal <redacted>
Reviewed-by: Martin K. Petersen <redacted>
Signed-off-by: Johannes Thumshirn <redacted>
---
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

Re: [PATCH v2] block: soft limit zone-append sectors as well

From: Jens Axboe <axboe@kernel.dk>
Date: 2020-10-07 14:22:48

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

Re: [PATCH v2] block: soft limit zone-append sectors as well

From: Johannes Thumshirn <hidden>
Date: 2020-10-07 14:23:26

On 07/10/2020 16:22, Jens Axboe wrote:
On 10/7/20 6:35 AM, Johannes Thumshirn wrote:
quoted
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 :)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help