>>>>> "Jiaying" == Jiaying Zhang <firstname.lastname@example.org> writes:
Jiaying> It is true that all of the block layer works on 512-byte sector
Jiaying> size, but I think it is good to check for address alignment for
Jiaying> discard request so we don't insert unnecessary discard requests
Jiaying> into the request queue.
Well, then what happens when you stripe or use DM on devices with
different discard granularity? Or what about a mirror? Or multiple
levels of stacking of heterogeneous devices.
There are good reasons why we postpone the logical block scaling until
we're preparing the request for the actual physical device.
Jiaying> There are also certain disk drivers that assume a discard
Jiaying> request passed from the block layer is already properly
Jiaying> aligned. We could argue that those disk drivers need to fix
Which is what I'm arguing :)
Jiaying> 512 bytes and 4KB seem to be the most common sizes but I
Jiaying> wouldn't be surprised to see other logical block size.
That's the reason I'm asking. If you have a different lbs then let's by
all means add support for it. Or make the ULD scaling generic.
I'm open to aligning to the reported discard granularity in the ULD, for
Martin K. Petersen Oracle Linux Engineering