]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
memcg: remove the lockdep assert from __mod_objcg_mlstate()
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Tue, 28 May 2024 14:13:41 +0000 (16:13 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 6 Jun 2024 02:19:24 +0000 (19:19 -0700)
The assert was introduced in the commit cited below as an insurance that
the semantic is the same after the local_irq_save() has been removed and
the function has been made static.

The original requirement to disable interrupt was due the modification
of per-CPU counters which require interrupts to be disabled because the
counter update operation is not atomic and some of the counters are
updated from interrupt context.

All callers of __mod_objcg_mlstate() acquire a lock
(memcg_stock.stock_lock) which disables interrupts on !PREEMPT_RT and
the lockdep assert is satisfied. On PREEMPT_RT the interrupts are not
disabled and the assert triggers.

The safety of the counter update is already ensured by
VM_WARN_ON_IRQS_ENABLED() which is part of __mod_memcg_lruvec_state() and
does not require yet another check.

Remove the lockdep assert from __mod_objcg_mlstate().

Link: https://lkml.kernel.org/r/20240528141341.rz_rytN_@linutronix.de
Fixes: 91882c1617c1 ("memcg: simple cleanup of stats update functions")
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Acked-by: Shakeel Butt <shakeel.butt@linux.dev>
Acked-by: Michal Hocko <mhocko@suse.com>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/memcontrol.c

index 7fad15b2290c70051261813190068fa77b8be62d..36793e509f4708b9aa1e08e8482a55b49797fb60 100644 (file)
@@ -3147,8 +3147,6 @@ static inline void __mod_objcg_mlstate(struct obj_cgroup *objcg,
        struct mem_cgroup *memcg;
        struct lruvec *lruvec;
 
-       lockdep_assert_irqs_disabled();
-
        rcu_read_lock();
        memcg = obj_cgroup_memcg(objcg);
        lruvec = mem_cgroup_lruvec(memcg, pgdat);