Re: [PATCH] mm/memcontrol: restore irq wrapper for lruvec_stat_mod_folio()

Shakeel Butt
2026-04-13T16:44:24Z

On Mon, Apr 13, 2026 at 02:48:33PM +0800, Cao Ruichuang wrote:
> Commit c1bd09994c4d ("memcg: remove __lruvec_stat_mod_folio") removed
> the local_irq_save/restore wrapper around lruvec_stat_mod_folio(), based
> on the assumption that the underlying stat update path was already
> IRQ-safe.

Why is that an assumption? Please explain how lruvec_stat_mod_folio() is not
safe against IRQs?

>
> That assumption is too broad for lruvec_stat_mod_folio() callers.
> This helper is not just a thin stat primitive. It also resolves
> folio -> memcg -> lruvec under a helper-managed RCU read-side section.
>
> syzbot now reports a PREEMPT_RT warning from:

The syzbot link you have provided has the kernel config without PREEMPT_RT?
Where does this claim come from?

>
> __filemap_add_folio()
> -> lruvec_stat_mod_folio()
> -> __rcu_read_unlock()
>
> ending in bad unlock balance / negative RCU nesting.

If there is bad unlock balance, how is disabling/enabling IRQs would solve that
issue?