linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* A plan for supporting PageMovable in 2025
@ 2025-03-17 17:00 Matthew Wilcox
  2025-03-17 17:37 ` Matthew Wilcox
  2025-03-18 10:12 ` David Hildenbrand
  0 siblings, 2 replies; 3+ messages in thread
From: Matthew Wilcox @ 2025-03-17 17:00 UTC (permalink / raw)
  To: linux-mm

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.



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-03-18 10:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-17 17:00 A plan for supporting PageMovable in 2025 Matthew Wilcox
2025-03-17 17:37 ` Matthew Wilcox
2025-03-18 10:12 ` David Hildenbrand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox