lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Fri, 17 Mar 2023 18:10:50 +0530
From:   Ojaswin Mujoo <>
To:     Andreas Dilger <>
Cc:     Jan Kara <>,
        Ext4 Developers List <>,
        "Theodore Ts'o" <>,
        Ritesh Harjani <>,,,
        rookxu <>,
        Ritesh Harjani <>
Subject: Re: [PATCH v3 7/8] ext4: Use rbtrees to manage PAs instead of inode

On Thu, Feb 16, 2023 at 10:07:39AM -0700, Andreas Dilger wrote:
> On Feb 10, 2023, at 7:37 AM, Jan Kara <> wrote:
> > So I belive mballoc tries to align everything (offsets & lengths)
> > to powers of two to reduce fragmentation and simplify the work for
> > the buddy allocator.  If ac->ac_b_ex.fe_len is a power-of-two, the
> > alignment makes sense. But once we had to resort to higher allocator
> > passes and just got some random-length extent, the alignment stops
> > making sense.
> In addition to optimizing for the buddy allocator, the other reason that
> the allocations are aligned to power-of-two offsets is to better align
> with underlying RAID stripes.  Otherwise, unaligned writes will cause
> parity read-modify-write updates to multiple RAID stripes.  This alignment
> can also help (though to a lesser degree) with NAND flash erase blocks.
> Cheers, Andreas
Got it, thanks. So from my limited understanding of RAID, if the write
is stripe aligned and the (length % stripe == 0) then we won't need a 
RMW cycle for parity bits and thats one of the reasons to pay attention
to alignment and length in mballoc code. 

Then I think Jan's reasoning still holds that if ac_b_ex.fe_len is already
not of a proper size then we'll anyways be ending with a RMW write in
RAID so no point of paying attention to its alignment, right?


Powered by blists - more mailing lists