Re: [PATCH v4 4/9] binder: remove struct binder_lru_page
From: Carlos Llamas
Date: Tue Nov 19 2024 - 15:16:21 EST
On Tue, Nov 19, 2024 at 07:10:49PM +0000, Matthew Wilcox wrote:
> On Tue, Nov 19, 2024 at 06:32:37PM +0000, Carlos Llamas wrote:
> > Remove the redundant struct binder_lru_page concept. Instead, let's use
> > available struct page->lru and page->private members directly to achieve
> > the same functionality.
>
> I'm not entirely happy to see this. I expect to start a patch series in
> the next six months which will remove users of page->lru. page->private
> is OK for now. The goal is to shrink struct page to 8 bytes, but I
> accept that 16 bytes may be the best we can do.
I see. I don't think that would be a problem. I'm only going after the
wasted duplication in binder. However, if page->lru is getting removed
I'd be happy to move to whatever is suggested as a replacement.
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?