[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <iww7fbadwh6srabn42qpyhskvhv4jvyibq6xjuhsnrxkmguuqu@mv76yy3aqi4h>
Date: Tue, 28 May 2024 09:21:22 -0700
From: Shakeel Butt <shakeel.butt@...ux.dev>
To: "Vlastimil Babka (SUSE)" <vbabka@...nel.org>
Cc: Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
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, linux-kernel@...r.kernel.org,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH v2] memcg: Remove the lockdep assert from
__mod_objcg_mlstate().
On Tue, May 28, 2024 at 05:07:06PM GMT, Vlastimil Babka (SUSE) wrote:
> On 5/28/24 4:59 PM, Shakeel Butt wrote:
> > On Tue, May 28, 2024 at 04:13:41PM GMT, Sebastian Andrzej Siewior wrote:
> >> 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.
> >
> > One question on VM_WARN_ON_IRQS_ENABLED() in __mod_memcg_lruvec_state().
> > On a PREEMPT_RT kernel with CONFIG_DEBUG_VM, will that
> > VM_WARN_ON_IRQS_ENABLED() cause a splat or VM_WARN_ON_IRQS_ENABLED is
> > special on PREEMPT_RT kernels?
>
> It only does something with CONFIG_DEBUG_VM_IRQSOFF and that's disabled by
> dependencies on PREEMPT_RT :)
Thanks for the explanation.
Powered by blists - more mailing lists