linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Linus Torvalds <torvalds@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>
Cc: Linux-MM <linux-mm@kvack.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [RFC] Free up a page flag
Date: Thu, 10 Mar 2022 09:36:02 +0100	[thread overview]
Message-ID: <f6730c85-096d-c523-661e-bb2ad80d96fe@redhat.com> (raw)
In-Reply-To: <CAHk-=wiKSXZyKu+LhZjXp+UnDa7kcOyPPG+C8n3K-3AQ3KgMhA@mail.gmail.com>

On 09.03.22 23:07, Linus Torvalds wrote:
> On Wed, Mar 9, 2022 at 12:50 PM Matthew Wilcox <willy@infradead.org> wrote:
>>
>> We're always running out of page flags.  Here's an attempt to free one
>> up for the next time somebody wants one.
> 
> Ugh. This is too ugly for words.
> 
> I wouldn't mind something along the conceptual lines of "these bits
> are only used for this type", but I think it would need to be much
> more organized and explicit, not this kind of randomness.
> 
> For example, quite a few of the page bits really only make sense for
> the "page cache and anonymous pages" kind.
> 
> I think this includes some really fundamental bits like the lock bit
> (and the associated waiters bit), along with a lot of the "owner" aka
> "this can be used by the filesystem" bits.
> 
> I think it _also_ includes all the LRU and workingset bits etc.
> 
> So if we consider that kind of case the "normal" case, the not-normal
> case is likely (a) slab, (b) reserved pages and (c) zspages.,
> 
> Which is pretty close to your "xyzzy" bit (I think you came to the
> same list of "slab or reserved" conclusion because of the fundamental
> issues above), but my point is that I think this approach is
> acceptable if we make it much less random, and make it a lot more
> explicit and thought through.
> 
> And we'd probably need to actually *verify* that we don't do things
> like lock (or LRU) those non-normal pages.
> 

Looking at isolate_movable_page(), I think we can easily end up locking
random pages temporarily. And especially non-lru page migration makes
use of it as well.

Personally, I'd not try restricting PG_lock and PG_waiter for specific
page types, it IMHO a way to generic infrastructure.

Other page flags are different and we already reuse them in different
context: e.g., reusing PG_uptodate for buddy pages via PG_reported.

-- 
Thanks,

David / dhildenb



  reply	other threads:[~2022-03-10  8:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-09 20:50 Matthew Wilcox
2022-03-09 22:07 ` Linus Torvalds
2022-03-10  8:36   ` David Hildenbrand [this message]
2022-03-10 15:39   ` Matthew Wilcox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f6730c85-096d-c523-661e-bb2ad80d96fe@redhat.com \
    --to=david@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=torvalds@linux-foundation.org \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox