linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: linux-mm@kvack.org
Subject: A plan for supporting PageMovable in 2025
Date: Mon, 17 Mar 2025 17:00:03 +0000	[thread overview]
Message-ID: <Z9hVE-SzM-IuS-6B@casper.infradead.org> (raw)

With the upcoming shrink of struct page to 4 words, we need a plan for
handling PageMovable.  Ideally this does not involve memory allocation,
and is a relatively simple change from what we have now.  To shrink
struct page beyond 4 words, we'll need a better plan, but I think this
will do for the next few months.
 
The current proposed layout for struct page is:

struct page {
    unsigned long flags;
    union {
        struct list_head buddy_list;
        struct list_head pcp_list;
        struct {
            unsigned long memdesc;
            union {
                unsigned long private;
                atomic_t _mapcount;
            };
        };
    };
    int _refcount;
};

My proposal for movable non-folio pages is:

 * memdesc is used to point to struct movable_operations (these will
   need to be aligned to 16 bytes, but I think that's fine)
 * private is used to point to the next page in the list
 * These pages are refcounted
 * We retain a "lock" bit in page->flags

The most disruptive part of this is that we can't use a list_head any
more.  I don't think a singly-linked list is prohibitive, but either
we need to switch folios to also use a singly-linked list, or we need
to handle folios & movable pages separately.  I think the former is
probably best.



             reply	other threads:[~2025-03-17 17:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-17 17:00 Matthew Wilcox [this message]
2025-03-17 17:37 ` Matthew Wilcox
2025-03-18 10:12 ` David Hildenbrand

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=Z9hVE-SzM-IuS-6B@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=linux-mm@kvack.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