Re: [PATCH 2/2] block: improve discard bio alignment in __blkdev_issue_discard()

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

 



On 2020/7/14 00:47, Martin K. Petersen wrote:
> 
> Hi Coly!
> 
>> This patch improves discard bio split for address and size alignment
>> in __blkdev_issue_discard(). The aligned discard bio may help
>> underlying device controller to perform better discard and internal
>> garbage collection, and avoid unnecessary internal fragment.
> 

Hi Martin,

> If the aim is to guarantee that all discard requests, except for head
> and tail, are aligned multiples of the discard_granularity, you also
> need to take the discard_alignment queue limit and the partition offset
> into consideration.
> 

The discard_granularity was considered and my though is,
discard_alignment normally is multiples of discard granularity, if the
discard bio bi_sector and bi_size are aligned to discard granularity,
when underlying driver splits its discard bio by discard_alignment, the
split bio bi_sector and bi_size can still be aligned to discard
granularity. Another reason I don't handle discard_alignment alignment
in __blkdev_issue_discard() is performance. Handling discard_alignment
bio split in driver's split loop may call blk_next_bio() much less in
__blkdev_issue_discard(), and be more friendly for memory and cache
footprint.

For the partition offset, my original idea was to suggest the partition
or dm target starts on offset 2048 sectors. But your opinion sound
better, if considering partition or target offset maybe users
misconfigured the partition offset may also gain the benefit of discard
alignment.

Let me try to improve a v3 patch to handle the partition offset too.

Thanks for the cool idea :-)

Coly Li




[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