2021-03-16 06:59:03

by Balbir Singh

[permalink] [raw]
Subject: Re: [PATCH] mm: memcontrol: switch to rstat fix

On 16/3/21 10:41 am, Johannes Weiner wrote:
> Fix a sleep in atomic section problem: wb_writeback() takes a spinlock
> and calls wb_over_bg_thresh() -> mem_cgroup_wb_stats, but the regular
> rstat flushing function called from in there does lockbreaking and may
> sleep. Switch to the atomic variant, cgroup_rstat_irqsafe().
>
> To be consistent with other memcg flush calls, but without adding
> another memcg wrapper, inline and drop memcg_flush_vmstats() instead.
>
> Signed-off-by: Johannes Weiner <[email protected]>
> ---

The patch make sense, but it does break any notion of abstraction we had
about controllers have some independence in their strategy to maintain
their own counters and stats. It now couples writeback with rstat instead
of just memcg.

Acked-by: Balbir Singh <[email protected]>