Re: block: revert to using min_not_zero() when stacking chunk_sectors
From: Mike Snitzer <hidden>
Date: 2020-12-01 02:14:01
Also in:
dm-devel
On Mon, Nov 30 2020 at 7:21pm -0500, John Dorminy [off-list ref] wrote:
quoted
If you're going to cherry pick a portion of a commit header please reference the commit id and use quotes or indentation to make it clear what is being referenced, etc.Apologies.quoted
Quite the tangent just to setup an a toy example of say: thinp with 256K blocksize/chunk_sectors ontop of a RAID6 with a chunk_sectors of 128K and stripesize of 1280K.I screwed up my math ... many apologies :/ Consider a thinp of chunk_sectors 512K atop a RAID6 with chunk_sectors 1280K. (Previously, this RAID6 would be disallowed because chunk_sectors could only be a power of 2, but 07d098e6bba removed this constraint.)
Think you have your example messed up still. RAID 10+2 with 128K chunk_sectors, 1280K full stripe (io_opt). Then thinp stacked ontop of it with chunk_sectors of 1280K was usecase that wasn't supported before. So stacked chunk_sectors = min_not_zero(128K, 1280K) = 128K
-With lcm_not_zero(), a full-device IO would be split into 2560K IOs, which obviously spans both 512K and 1280K chunk boundaries.
Sure, think we both agree lcm_not_zero() shouldn't be used.
-With min_not_zero(), a full-device IO would be split into 512K IOs, some of which would span 1280k chunk boundaries. For instance, one IO would span from offset 1024K to 1536K.
RAID6 with chunk_sectors of 1280K is pretty insane... And yet you're saying full device IO is 1280K... So something still isn't adding up. Anyway, if we run with your example of chunk_sectors (512K, 1280K), yes there is serious potential for IO to span the RAID6 layer's chunk_sector boundary.
-With the hypothetical gcd_not_zero(), a full-device IO would be split into 256K IOs, which span neither 512K nor 1280K chunk boundaries.
Yeap, I see.
quoted
To be clear, you are _not_ saying using lcm_not_zero() is correct. You're saying that simply reverting block core back to using min_not_zero() may not be as good as using gcd().Assuming my understanding of chunk_sectors is correct -- which as per blk-settings.c seems to be "a driver will not receive a bio that spans a chunk_sector boundary, except in single-page cases" -- I believe using lcm_not_zero() and min_not_zero() can both violate this requirement. The current lcm_not_zero() is not correct, but also reverting block core back to using min_not_zero() leaves edge cases as above.
But your chunk_sectors (512K, 1280K) example is a misconfigured IO stack. Really not sure it worth being concerned about it.
I believe gcd provides the requirement, but min_not_zero() + disallowing non-power-of-2 chunk_sectors also provides the requirement.
Kind of on the fence on this... think I'd like to get Martin's take. Using gcd() instead of min_not_zero() to stack chunk_sectors isn't a big deal; given the nature of chunk_sectors coupled with it being able to be a non-power-of-2 _does_ add a new wrinkle. So you had a valid point all along, just that you made me work pretty hard to understand you.
quoted
quoted
But it's possible I'm misunderstanding the purpose of chunk_sectors, or there should be a check that the one of the two devices' chunk sizes divides the other.Seriously not amused by your response, I now have to do damage control because you have a concern that you really weren't able to communicate very effectively.Apologies.
Eh, I need to build my pain threshold back up.. been away from it all for more than a week.. ;) Mike