Re: [PATCH v4 4/9] binder: remove struct binder_lru_page

From: Matthew Wilcox
Date: Tue Nov 19 2024 - 21:45:35 EST


On Tue, Nov 19, 2024 at 08:16:07PM +0000, Carlos Llamas wrote:
> If you are planning to keep page->private, I think we can just hang our
> binder items in there. Something like...
>
> struct binder_page_items *bp;
> struct page *p;
>
> bp = kzalloc(sizeof(*bp), GFP_KERNEL);
> bp->alloc = alloc;
> INIT_LIST_HEAD(&bp->lru);
> bp->index = index;
>
> p = alloc_page(...);
> p->private = (unsigned long)bp;
>
> This would be absolutely fine in binder. Is this what you had in mind
> for current users of page->lru?

Something like that, yes. Although you wouldn't even need to use
page->private for it; you'd be able to use page->memdesc directly,
and then not be in the way of shrinking to 8 bytes.