On Mon, Feb 10, 2025 at 01:14:00PM +0100, Hannes Reinecke wrote: > 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? There isn't min_segment_size setting, at block layer takes PAGE_SIZE as the actual min_segment_size. > > > 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? The comment explains it already: 4K = min(PAGE_SIZE). Thanks, Ming