Re: [PATCH] memcg: multi-memcg percpu charge cache

Shakeel Butt
2025-04-29T14:50:25Z

On Tue, Apr 29, 2025 at 2:40 AM Hugh Dickins <hughd@google.com> wrote:
>
> [PATCH mm-unstable] memcg: multi-memcg percpu charge cache - fix 3
>
> Fix 2 has been giving me lots of memcg OOM kills not seen before:
> it's better to stock nr_pages than the uninitialized stock_pages.
>
> Signed-off-by: Hugh Dickins <hughd@google.com>

Thanks a lot Hugh for catching this.

> ---
> mm/memcontrol.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 178d79e68107..02c6f553dc53 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -1952,7 +1952,7 @@ static void refill_stock(struct mem_cgroup *memcg, unsigned int nr_pages)
> }
> css_get(&memcg->css);
> WRITE_ONCE(stock->cached[i], memcg);
> - WRITE_ONCE(stock->nr_pages[i], stock_pages);
> + WRITE_ONCE(stock->nr_pages[i], nr_pages);
> }
>
> local_unlock_irqrestore(&memcg_stock.stock_lock, flags);