lkml.org 
[lkml]   [2022]   [Nov]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH 1/4] mm: introduce 'encoded' page pointers with embedded extra bits
    On Wed, Nov 9, 2022 at 10:00 AM Linus Torvalds
    <torvalds@linux-foundation.org> wrote:
    >
    > But while I think a BUILD_BUG_ON() would be the right thing to do
    > here, I do not feel confident enough to really put that to the test.

    Oh, what the hell.

    Just writing that whole explanation out made me just go "let's try to
    re-organize it a bit so that we *can* inline everything, and see how
    well it works".

    And it does actually work to use BUILD_BUG_ON(), both with gcc and clang.

    At least that's the case with the versions of gcc and clang _I_ use,
    and in the configurations I tested.

    So now I have a slightly massaged version of the patches (I did have
    to move the 'encode_page()' around a bit), which has that
    BUILD_BUG_ON() in it, and it passes for me.

    And I find that I really like seeing that whole page pointer encoding
    be so obviously much stricter. That was obviously the point of the
    whole separate type system checking, now it does bit value validity
    checking too.

    So I'll walk through my patches one more time to check for it, but
    I'll post it as a git branch and send out a new series (and do it in a
    separate thread with a cover letter, to not confuse the little mind of
    'b4' again).

    If it turns out that some other compiler version or configuration
    doesn't deal with the BUILD_BUG_ON() gracefully, it's easy enough to
    remove, and it will hopefully show up in linux-next when Andrew picks
    it up.

    Linus

    \
     
     \ /
      Last update: 2022-11-09 21:03    [W:2.549 / U:0.000 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site