On 2/10/25 10:03, Ming Lei wrote:
PAGE_SIZE is applied in some block device queue limits, this way is
very fragile and is wrong:
- queue limits are read from hardware, which is often one readonly
hardware property
- PAGE_SIZE is one config option which can be changed during build time.
In RH lab, it has been found that max segment size of some mmc card is
less than 64K, then this kind of card can't work in case of 64K PAGE_SIZE.
So why isn't this reflected in the blk_min_segment settings?
Or, rather, why isn't setting blk_min_segment not enough?
Fix this issue by using BLK_MIN_SEGMENT_SIZE in related code for dealing
with queue limits and checking if bio needn't split. Define BLK_MIN_SEGMENT_SIZE
as 4K(minimized PAGE_SIZE).
But why 4k then? That is a value like anything else, and what is the
rationale to use that instead of the more natural sector size?
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@xxxxxxx +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich