Re: [PATCH v1 04/26] mm: vmscan: refactor move_folios_to_lru()
From: Shakeel Butt
Date: Sat Nov 08 2025 - 01:33:11 EST
On Fri, Nov 07, 2025 at 10:20:57PM +0900, Harry Yoo wrote:
>
> Although it's mentioned in the locking documentation, I'm afraid that
> local_lock is not the right interface to use here. Preemption will be
> disabled anyway (on both PREEMPT_RT and !PREEMPT_RT) when the stats are
> updated (in __mod_node_page_state()).
>
> Here we just want to disable IRQ only on !PREEMPT_RT (to update
> the stats safely).
I don't think there is a need to disable IRQs. There are three stats
update functions called in that hunk.
1) __mod_lruvec_state
2) __count_vm_events
3) count_memcg_events
count_memcg_events() can be called with IRQs. __count_vm_events can be
replaced with count_vm_events. For __mod_lruvec_state, the
__mod_node_page_state() inside needs preemption disabled.
Easy way would be to just disable/enable preemption instead of IRQs.
Otherwise go a bit more fine-grained approach i.e. replace
__count_vm_events with count_vm_events and just disable preemption
across __mod_node_page_state().