Re: [PATCH] block: align max append sectors to physical block size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2020/07/17 16:50, Ming Lei wrote:
> On Fri, Jul 17, 2020 at 02:45:25AM +0000, Damien Le Moal wrote:
>> On 2020/07/16 23:35, Christoph Hellwig wrote:
>>> On Thu, Jul 16, 2020 at 07:09:33PM +0900, Johannes Thumshirn wrote:
>>>> Max append sectors needs to be aligned to physical block size, otherwise
>>>> we can end up in a situation where it's off by 1-3 sectors which would
>>>> cause short writes with asynchronous zone append submissions from an FS.
>>>
>>> Huh? The physical block size is purely a hint.
>>
>> For ZBC/ZAC SMR drives, all writes must be aligned to the physical sector size.
> 
> Then the physical block size should be same with logical block size.
> The real workable limit for io request is aligned with logical block size.

Yes, I know. This T10/T13 design is not the brightest thing they did... on 512e
SMR drives, addressing is LBA=512B unit, but all writes in sequential zones must
be 4K aligned (8 LBAs).

> 
>> However, sd/sd_zbc does not change max_hw_sectors_kb to ensure alignment to 4K
>> on 512e disks. There is also nullblk which uses the default max_hw_sectors_kb to
>> 255 x 512B sectors, which is not 4K aligned if the nullb device is created with
>> 4K block size.
> 
> Actually the real limit is from max_sectors_kb which is <= max_hw_sectors_kb, and
> both should be aligned with logical block size, IMO.

Yes, agreed, but for nullblk device created with block size = 4K it is not. So
one driver to patch for sure. However, I though having some forced alignment in
blk_queue_max_hw_sectors() for limit->max_hw_sectors and limit->max_sectors
would avoid tripping on weird values for weird drives...



-- 
Damien Le Moal
Western Digital Research




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux