All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block: soft limit zone-append sectors as well
@ 2020-10-07  9:20 Johannes Thumshirn
  2020-10-07 11:21 ` Damien Le Moal
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Johannes Thumshirn @ 2020-10-07  9:20 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-fsdevel, linux-block, Damien Le Moal, Christoph Hellwig,
	Johannes Thumshirn, Martin K . Petersen

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>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
 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..967cd76f16d4 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;
+
+	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] 9+ messages in thread

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

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-07  9:20 [PATCH] block: soft limit zone-append sectors as well Johannes Thumshirn
2020-10-07 11:21 ` Damien Le Moal
2020-10-07 11:40 ` kernel test robot
2020-10-07 11:40   ` kernel test robot
2020-10-07 12:14 ` Christoph Hellwig
2020-10-07 12:25 ` Martin K. Petersen
2020-10-07 12:28   ` Johannes Thumshirn
2020-10-07 13:58 ` Jens Axboe
2020-10-07 14:19   ` Johannes Thumshirn

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.