Re: [PATCH v5 09/16] kexec: enable KHO support for memory preservation

From: Mike Rapoport
Date: Mon Mar 24 2025 - 14:18:57 EST


On Sun, Mar 23, 2025 at 03:55:52PM -0300, Jason Gunthorpe wrote:
> On Sat, Mar 22, 2025 at 03:12:26PM -0400, Mike Rapoport wrote:
>
> > > > + page->private = order;
> > >
> > > Can't just set the page order directly? Why use private?
> >
> > Setting the order means recreating the folio the way prep_compound_page()
> > does. I think it's better to postpone it until the folio is requested. This
> > way it might run after SMP is enabled.
>
> I see, that makes sense, but also it could stil use page->order..

But there's no page->order :)

> > Besides, when we start allocating
> > folios separately from struct page, initializing it here would be a real
> > issue.
>
> Yes, but also we wouldn't have page->private to make it work.. Somehow
> anything we want to carry over would have to become encoded in the
> memdesc directly.

This is a problem to solve in 2026 :)

The January update for State of Page [1] talks about

reasonable goal to shrink struct page to (approximately):

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

[1] https://lore.kernel.org/linux-mm/Z37pxbkHPbLYnDKn@xxxxxxxxxxxxxxxxxxxx/

> Jason

--
Sincerely yours,
Mike.