diff options
author | Johannes Thumshirn <johannes.thumshirn@wdc.com> | 2020-10-07 15:35:08 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-10-07 17:22:15 +0300 |
commit | fe6f0cdc49263ae61cd3d33399662808c2398e86 (patch) | |
tree | d53971e8ace0c8dba96ad12d5cbe3847250153da /include/linux/blkdev.h | |
parent | a926c7afffcc0f2e35e6acbccb16921bacf34617 (diff) | |
download | linux-fe6f0cdc49263ae61cd3d33399662808c2398e86.tar.xz |
block: soft limit zone-append sectors as well
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.
Reported-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Link: https://lore.kernel.org/linux-btrfs/yq1k0w8g3rw.fsf@ca-mkp.ca.oracle.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux/blkdev.h')
-rw-r--r-- | include/linux/blkdev.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index cda786fa4341..6bd667c34777 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -1407,7 +1407,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) |