Re: [PATCH v2 1/5] memcg: move memory.high enforcement out of try_charge_memcg()

From: Muchun Song

Date: Fri Oct 30 2026 - 20:46:10 EST




> On Oct 31, 2026, at 04:54, Shakeel Butt <shakeel.butt@xxxxxxxxx> wrote:
>
> try_charge_memcg() does a lot. It charges the page counters, reclaims
> when a limit is hit, may call the OOM killer, and at the end it checks
> and enforces memory.high. Move the memory.high part into a new function,
> memcg_enforce_high(), so that try_charge_memcg() is shorter and the
> memory.high code is easier to read and change.
>
> The code and its comments move as they are. The only difference is that
> the new function gets allow_spinning from gfp_mask itself.
>
> No functional change.
>
> Signed-off-by: Shakeel Butt <shakeel.butt@xxxxxxxxx>
> Reviewed-by: Harry Yoo (Meta) <harry@xxxxxxxxxx>
> Acked-by: Michal Hocko <mhocko@xxxxxxxx>

Acked-by: Muchun Song <muchun.song@xxxxxxxxx>

Thanks.