]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
block: Increase BLK_DEF_MAX_SECTORS_CAP
authorDamien Le Moal <dlemoal@kernel.org>
Wed, 18 Jun 2025 06:00:45 +0000 (15:00 +0900)
committerJens Axboe <axboe@kernel.dk>
Mon, 30 Jun 2025 21:50:31 +0000 (15:50 -0600)
commit9b8b84879d4adc506b0d3944e20b28d9f3f6994b
treeb7bc9c011128bddbb0c55df161ad1ae13a5cc473
parentd0b3b7b22dfa1f4b515fd3a295b3fd958f9e81af
block: Increase BLK_DEF_MAX_SECTORS_CAP

Back in 2015, commit d2be537c3ba3 ("block: bump BLK_DEF_MAX_SECTORS to
2560") increased the default maximum size of a block device I/O to 2560
sectors (1280 KiB) to "accommodate a 10-data-disk stripe write with
chunk size 128k". This choice is rather arbitrary and since then,
improvements to the block layer have software RAID drivers correctly
advertize their stripe width through chunk_sectors and abuses of
BLK_DEF_MAX_SECTORS_CAP by drivers (to set the HW limit rather than the
default user controlled maximum I/O size) have been fixed.

Since many block devices can benefit from a larger value of
BLK_DEF_MAX_SECTORS_CAP, and in particular HDDs, increase this value to
be 4MiB, or 8192 sectors.

And given that BLK_DEF_MAX_SECTORS_CAP is only used in the block layer
and should not be used by drivers directly, move this macro definition
to the block layer internal header file block/blk.h.

Suggested-by: Martin K . Petersen <martin.petersen@oracle.com>
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: John Garry <john.g.garry@oracle.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Link: https://lore.kernel.org/r/20250618060045.37593-1-dlemoal@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk.h
include/linux/blkdev.h