News: 0001491150

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

EXT4 Extsize Hints Being Worked On As Step Toward Non-Torn/Atomic Writes

([Linux Storage] 3 Hours Ago EXT4 Extsize Hints)


Ojaswin Mujoo with IBM has posted an initial set of "request for comments" patches implementing extsize hints for EXT4, similar to the hints being worked on for the XFS file-system. This is important work in ultimately striving toward handling non-torn / atomic writes within the EXT4 file-system.

Mujoo explains of the extsize hints work for EXT4:

"extsize on ext4 is a hint to mballoc (multi-block allocator) and extent handling layer to do aligned allocations. We use allocation criteria 0 (CR_POWER2_ALIGNED) for doing aligned power-of-2 allocations. With extsize hint we try to align the logical start (m_lblk) and length(m_len) of the allocation to be extsize aligned. CR_POWER2_ALIGNED criteria in mballoc automatically make sure that we get the aligned physical start (m_pblk) as well. So in this way extsize can make sure that lblk, len and pblk all are aligned for the allocated extent w.r.t extsize.

Note that extsize feature is just a hinting mechanism to ext4 multi-block allocator. That means that if we are unable to get an aligned allocation for some reason, than we drop this flag and continue with unaligned allocation to serve the request. However when we will add atomic/untorn writes support, then we will enforce the aligned allocation and can return -ENOSPC if aligned allocation was not successful."

The patch that adds the actual extsize hints support for the EXT4 file-system goes on to elegantly sum it up as:

"** MOTIVATION **

1. This feature allows us to ask the allocator for blocks that are logically AS WELL AS physically aligned to an extent size hint (aka extsize), that is generally a power of 2.

2. This means both start and the length of the physical and logical range should be aligned to the extsize.

3. This sets up the infra we'll eventually need for supporting non-torn/atomic writes that need to follow a certain alignment as required by hardware.

4. This can also be extent to other use cases like stripe alignment"

As it's just in an RFC phase of development right now, it still may be some time before the design is solidified and the patches are ready for upstreaming into the Linux kernel. In any event for those wanting to learn more about the EXT4 extsize hints proposal can find the patches [1]on the Linux kernel mailing list .



[1] https://lore.kernel.org/lkml/cover.1726034272.git.ojaswin@linux.ibm.com/



phoronix

Rules for Writers:
Avoid run-on sentences they are hard to read. Don't use no double
negatives. Use the semicolon properly, always use it where it is appropriate;
and never where it isn't. Reserve the apostrophe for it's proper use and
omit it when its not needed. No sentence fragments. Avoid commas, that are
unnecessary. Eschew dialect, irregardless. And don't start a sentence with
a conjunction. Hyphenate between sy-llables and avoid un-necessary hyphens.
Write all adverbial forms correct. Don't use contractions in formal writing.
Writing carefully, dangling participles must be avoided. It is incumbent on
us to avoid archaisms. Steer clear of incorrect forms of verbs that have
snuck in the language. Never, ever use repetitive redundancies. If I've
told you once, I've told you a thousand times, resist hyperbole. Also,
avoid awkward or affected alliteration. Don't string too many prepositional
phrases together unless you are walking through the valley of the shadow of
death. "Avoid overuse of 'quotation "marks."'"