Re: [PATCH] mm: memcg: stop reclaim when a limit update is superseded
From: Michal Hocko
Date: Mon Jul 27 2026 - 04:20:34 EST
On Fri 24-07-26 10:18:05, Guopeng Zhang wrote:
> From: Guopeng Zhang <zhangguopeng@xxxxxxxxxx>
>
> kernfs serializes file operations only per open file, so separate open
> files can update the same memory.high or memory.max file concurrently.
> Both handlers store the new limit before synchronous reclaim, but
> continue to use the writer's local target in the reclaim loop. If another
> writer raises or removes the limit, the first writer can continue
> reclaiming toward a stale target.
>
> For memory.max, this can leave the writer looping indefinitely once
> reclaim retries are exhausted. The OOM path sees sufficient margin under
> the current limit and returns true without killing, while the writer
> still compares usage against its stale target and records another OOM
> event.
The current behavior is deliberate as described in b6e6edcfa4056.
What is an actual problem you are trying to fix?
--
Michal Hocko
SUSE Labs