lkml.org 
[lkml]   [2023]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH v3 7/8] ext4: Use rbtrees to manage PAs instead of inode i_prealloc_list
    Date
    On Feb 10, 2023, at 7:37 AM, Jan Kara <jack@suse.cz> 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





    [unhandled content-type:application/pgp-signature]
    \
     
     \ /
      Last update: 2023-03-27 00:26    [W:3.443 / U:0.040 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site