On 18/06/2025 07:00, Damien Le Moal wrote:
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@xxxxxxxxxx> Signed-off-by: Damien Le Moal <dlemoal@xxxxxxxxxx> Reviewed-by: Martin K. Petersen <martin.petersen@xxxxxxxxxx>
Regardless of comment below: Reviewed-by: John Garry <john.g.garry@xxxxxxxxxx>
--- Changes from v1: - Move BLK_DEF_MAX_SECTORS_CAP definition to block/blk.h
it's only referenced in blk-settings.c, so I don't know why it doesn't live there.
However it is co-located with enum blk_default_limits and the same comment goes for members of enum blk_default_limits. I think all those in enum blk_default_limits could potentially be moved to blk-settings.c after Christoph's work for atomic queue limit updates.