[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250314114405.4x6EuYYW@linutronix.de>
Date: Fri, 14 Mar 2025 12:44:05 +0100
From: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To: Vlastimil Babka <vbabka@...e.cz>
Cc: Shakeel Butt <shakeel.butt@...ux.dev>,
Andrew Morton <akpm@...ux-foundation.org>,
Johannes Weiner <hannes@...xchg.org>,
Michal Hocko <mhocko@...nel.org>,
Roman Gushchin <roman.gushchin@...ux.dev>,
Muchun Song <muchun.song@...ux.dev>, linux-mm@...ck.org,
cgroups@...r.kernel.org, linux-kernel@...r.kernel.org,
Meta kernel team <kernel-team@...a.com>
Subject: Re: [RFC PATCH 07/10] memcg: use __mod_memcg_state in drain_obj_stock
On 2025-03-14 11:27:40 [+0100], Vlastimil Babka wrote:
> On 3/14/25 07:15, Shakeel Butt wrote:
> > For non-PREEMPT_RT kernels, drain_obj_stock() is always called with irq
> > disabled, so we can use __mod_memcg_state() instead of
> > mod_memcg_state(). For PREEMPT_RT, we need to add memcg_stats_[un]lock
> > in __mod_memcg_state().
> >
> > Signed-off-by: Shakeel Butt <shakeel.butt@...ux.dev>
>
> Maybe it'll make sense later but as of this patch itself it begs a question
> why put memcg_stats_lock()/unlock() in __mod_memcg_state itself and not just
> around the call in drain_obj_stock()?
The memcg_stats_lock() were introduce to protect the per-CPU counters
(vmstats_percpu) on PREEMPT_RT which are protected on !PREEMPT_RT by
disabling interrupts. Other modifier have this already except for
__mod_memcg_state() because mod_memcg_state() was the only user and
already disables interrupt for the operation.
Sebastian
Powered by blists - more mailing lists