[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wj10fOhx9-dkmRrttgXmhVihhwfTT=bdhqVQwC=sPUE2A@mail.gmail.com>
Date: Tue, 8 Nov 2022 12:46:44 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Nadav Amit <nadav.amit@...il.com>
Cc: Hugh Dickins <hughd@...gle.com>,
Johannes Weiner <hannes@...xchg.org>,
Andrew Morton <akpm@...ux-foundation.org>,
kernel list <linux-kernel@...r.kernel.org>, linux-mm@...ck.org
Subject: Re: [PATCH 1/4] mm: introduce 'encoded' page pointers with embedded
extra bits
On Tue, Nov 8, 2022 at 12:37 PM Nadav Amit <nadav.amit@...il.com> wrote:
>
> > +static inline bool encoded_page_flags(struct encoded_page *page)
> > +{
> > + return ENCODE_PAGE_BITS & (unsigned long)page;
> > +}
>
> I think this one wants to be some unsigned, as otherwise why have
> ENCODE_PAGE_BITS as 3ul ?
Right you are. That came from my old old version where this was just
"bool dirty".
Will fix.
Doesn't matter for the TLB flushing case, but I really did hope that
we could use this for mlock too, and that case needs both bits.
I did look at converting mlock (and it's why I wanted to make
release_pages() take that whole encoded thing in general, rather than
make some special case for it), but the mlock code uses that "struct
pagevec" abstraction that seems entirely pointless ("pvec->nr" becomes
"pagevec_count(pvec)", which really doesn't seem to be any clearer at
alll), but whatever.
Linus
Powered by blists - more mailing lists