Re: [PATCH] mm/memcontrol: restore irq wrapper for lruvec_stat_mod_folio()
From: Vlastimil Babka (SUSE)
Date: Tue Apr 14 2026 - 03:56:48 EST
On 4/13/26 18:44, Shakeel Butt wrote:
> 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?
This is obviously a product of LLM producing a patch from the syzbot report.
I suggest we ignore everything from this author.