Skip to content

Commit 5fabff6

Browse files
Harry Yoojfvogel
authored andcommitted
mm: vmscan: disable IRQ before __mod_lruvec_state()
__mod_lruvec_state() assumes that IRQ is disabled except when the stat idx is NR_ANON_MAPPED, NR_FILE_MAPPED, and NR_ANON_THPS. Not disabling IRQ before __mod_lruvec_state() in shrink_inactive_list() triggers VM_WARN_ON_IRQS_ENABLED(): WARNING: CPU: 9 PID: 180461 at mm/memcontrol.c:915 __mod_memcg_lruvec_state+0x20a/0x220 [...] Call Trace: <TASK> shrink_inactive_list+0x1be/0x500 shrink_lruvec+0x3a0/0x4f0 ? lock_release+0x101/0x150 ? srso_alias_return_thunk+0x5/0xfbef5 ? lock_acquire+0x107/0x140 ? srso_alias_return_thunk+0x5/0xfbef5 ? lock_acquire+0x107/0x140 shrink_node_memcgs+0x1db/0x270 shrink_node+0x11d/0x440 ? srso_alias_return_thunk+0x5/0xfbef5 ? srso_alias_return_thunk+0x5/0xfbef5 ? zone_reclaimable_pages+0x15c/0x200 shrink_zones.constprop.0+0xb9/0x2b0 do_try_to_free_pages+0x4a/0x2f0 [...] </TASK> Disable IRQ before calling __mod_lruvec_state(). This appears to be a mistake in commit d6530a1 ("mm: vmscan: rework move_pages_to_lru()"). The latest version [1] of Muchun's lruvec reparenting series handles this correctly. Orabug: 37997618 Link: https://lore.kernel.org/linux-mm/[email protected] [1] Fixes: d6530a1 ("mm: vmscan: rework move_pages_to_lru()") Reviewed-by: Sidhartha Kumar <[email protected]> Reviewed-by: Imran Khan <[email protected]> Signed-off-by: Harry Yoo <[email protected]>
1 parent 8bb0a9f commit 5fabff6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/vmscan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1976,9 +1976,9 @@ static unsigned long shrink_inactive_list(unsigned long nr_to_scan,
19761976

19771977
move_folios_to_lru(&folio_list);
19781978

1979+
local_irq_disable();
19791980
__mod_lruvec_state(lruvec, PGDEMOTE_KSWAPD + reclaimer_offset(),
19801981
stat.nr_demoted);
1981-
local_irq_disable();
19821982
__mod_node_page_state(pgdat, NR_ISOLATED_ANON + file, -nr_taken);
19831983
item = PGSTEAL_KSWAPD + reclaimer_offset();
19841984
if (!cgroup_reclaim(sc))

0 commit comments

Comments
 (0)