Re: [RFC 06/10] Reclaim memory from blocked kernel stacks

From: Peter Zijlstra

Date: Sat Aug 29 2026 - 04:43:56 EST


On Sat, Aug 29, 2026 at 10:39:29AM +0200, Peter Zijlstra wrote:

> > The optimistic fast path for repopulate_stack() could be modified to
> > try pulling from a pre-allocated pool of zero'ed pages. That would
> > reduce the function to a couple of memcg_kmem_charge_page() calls and
>
> Afaict memcg_kmem_charge_page() ends up in a local_lock, which is a
> spinlock, so that cannot be.

Perhaps just don't uncharge them on reclaim, then you don't have to
re-charge.