Re: [PATCH v8 0/6] mm/vmalloc: free unused pages on vrealloc() shrink
From: Uladzislau Rezki
Date: Mon Mar 30 2026 - 08:36:08 EST
On Mon, Mar 30, 2026 at 08:05:44AM +0000, Alice Ryhl wrote:
> On Fri, Mar 27, 2026 at 11:37:58AM -0700, Andrew Morton wrote:
> > On Fri, 27 Mar 2026 15:18:36 +0530 Shivam Kalra via B4 Relay <devnull+shivamkalra98.zohomail.in@xxxxxxxxxx> wrote:
> >
> > > This series implements the TODO in vrealloc() to unmap and free unused
> > > pages when shrinking across a page boundary.
> >
> > Thanks. I'd prefer to defer this until the next -rc cycle
> > (https://lkml.kernel.org/r/20260323202941.08ddf2b0411501cae801ab4c@xxxxxxxxxxxxxxxxxxxx).
> > If Ulad would prefer that we push ahead then OK.
>
> That's fine. No rush from my side.
>
> > Are we able to describe how much memory this change might save under
> > various scenarios? If the savings are impressively large then that
> > would get attention.
>
> The primary purpose of this is to ensure that this scenario is not
> possible:
>
> * There is a global list in the Binder driver. It's an array allocated
> using kvmalloc and resized on demand using kvrealloc.
> * A process decides to add a bajillion elements to that global list.
> * The process exits, taking its entries with it.
> * The global list now remains extremely large for no good reason.
>
> I don't know if it would save a significant amount of memory for
> well-behaved programs.
>
> Alice
Agree, let's postpone this, so i have a chance to check it one more
time even though it seems ready.
--
Uladzislau Rezki