Messages in this thread | | | Subject | Re: [PATCH, RFC] addjust discard request to be aligned with hwsect size to support SSDs with larger sector size | From | "Martin K. Petersen" <> | Date | Mon, 17 May 2010 14:57:22 -0400 |
| |
>>>>> "Jiaying" == Jiaying Zhang <jiayingz@google.com> writes:
Jiaying,
Jiaying> The currect blkdev_issue_discard() function assumes 512 sector Jiaying> size.
All of the block layer works on 512-byte sector units. We don't generally convert to logical blocks until we're in the disk driver.
Jiaying> We have seen some problem when using discard on a SSD that has Jiaying> larger sector size. The following patch adjusts the starting Jiaying> address and size of a discard request to be aligned with hwsect Jiaying> size.
Jiaying> + int hwsect_shift = Jiaying> blksize_bits(bdev_logical_block_size(bdev)) - 9;
Let's stop using the term hardware sector size. It's an anachronism.
I guess I could understand if you aligned to the physical block size. But the logical doesn't make much sense to me.
What is your logical block size? Right now we only handle 512 bytes and 4KB in the discard path.
-- Martin K. Petersen Oracle Linux Engineering
| |