From nobody Mon Feb 9 17:07:15 2026 Received: from out-179.mta1.migadu.com (out-179.mta1.migadu.com [95.215.58.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 447B43A0B3F for ; Thu, 5 Feb 2026 08:56:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770281819; cv=none; b=kvR/KprsbEO0oxdWYO+TA/0eLsYPAxgz0h1J1SKLwvZdP1R0+zvBJoaWZCwdcanrZQFAuQGjG9ZDGEtGnDhBaWoqDCAS616e4No6I3I60hr0R9OVg7wHWrZwCiSqYhMt2g9IjrH/7riyr7SXAsnp4913VT0hIuIprDDd3HUHhKc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770281819; c=relaxed/simple; bh=gb+BlsbmqoUFTzukJ1TbOhAoGI/WoOP8IpI2kzXOECw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DzfjpaBrMPQF+PEjHZGbFNyroxxdNbsBMMJ3adQwnk5H1/c2cpJ8wKoZeSf5kj8pAJ6rtx4OZ0N3nkgbvx4iKXAbdlcbHG8VoXE7A9XHKphZi9HQGas7W6MDOPQAnhJx642pKPTE+ZCWRMGLJxNac/ELbNhV5j8X+NuhC8nQkaI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=rLlYUxEO; arc=none smtp.client-ip=95.215.58.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="rLlYUxEO" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1770281817; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Xl55ZD/XpxuV+TwMC87ANkfW8PG21jVvZfSxHlx1S54=; b=rLlYUxEOw0iWYZ4PNnhDDiZpDRQmGWtNZYhMjkOs7ukos96vL4wekfsabjh5SBEnAHtCWs k2VFJrJk9OHsKvnamwLWa5fq/jxdbJPNANyWbDRKoABAV1YaM1cS7NwVW1F0Rxi48pw8c+ n0BGRtlAaOs3GY95R4tzkHiB5eCxNFo= From: Qi Zheng To: hannes@cmpxchg.org, hughd@google.com, mhocko@suse.com, roman.gushchin@linux.dev, shakeel.butt@linux.dev, muchun.song@linux.dev, david@kernel.org, lorenzo.stoakes@oracle.com, ziy@nvidia.com, harry.yoo@oracle.com, yosry.ahmed@linux.dev, imran.f.khan@oracle.com, kamalesh.babulal@oracle.com, axelrasmussen@google.com, yuanchu@google.com, weixugc@google.com, chenridong@huaweicloud.com, mkoutny@suse.com, akpm@linux-foundation.org, hamzamahfooz@linux.microsoft.com, apais@linux.microsoft.com, lance.yang@linux.dev, bhe@redhat.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, Qi Zheng , Chen Ridong Subject: [PATCH v4 04/31] mm: vmscan: prepare for the refactoring the move_folios_to_lru() Date: Thu, 5 Feb 2026 16:54:33 +0800 Message-ID: <2a61a9f46870a987ec4426cbf88177d9e2ddd628.1770279888.git.zhengqi.arch@bytedance.com> In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: Qi Zheng Once we refactor move_folios_to_lru(), its callers will no longer have to hold the lruvec lock; For shrink_inactive_list(), shrink_active_list() and evict_folios(), IRQ disabling is only needed for __count_vm_events() and __mod_node_page_state(). To avoid using local_irq_disable() on the PREEMPT_RT kernel, let's make all callers of move_folios_to_lru() use IRQ-safed count_vm_events() and mod_node_page_state(). Signed-off-by: Qi Zheng Acked-by: Johannes Weiner Acked-by: Shakeel Butt Reviewed-by: Chen Ridong Reviewed-by: Harry Yoo Acked-by: Muchun Song --- mm/vmscan.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index a4892f5e3d347..f595e063faeec 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -2028,12 +2028,12 @@ static unsigned long shrink_inactive_list(unsigned = long nr_to_scan, =20 mod_lruvec_state(lruvec, PGDEMOTE_KSWAPD + reclaimer_offset(sc), stat.nr_demoted); - __mod_node_page_state(pgdat, NR_ISOLATED_ANON + file, -nr_taken); + mod_node_page_state(pgdat, NR_ISOLATED_ANON + file, -nr_taken); item =3D PGSTEAL_KSWAPD + reclaimer_offset(sc); if (!cgroup_reclaim(sc)) - __count_vm_events(item, nr_reclaimed); + count_vm_events(item, nr_reclaimed); count_memcg_events(lruvec_memcg(lruvec), item, nr_reclaimed); - __count_vm_events(PGSTEAL_ANON + file, nr_reclaimed); + count_vm_events(PGSTEAL_ANON + file, nr_reclaimed); =20 lru_note_cost_unlock_irq(lruvec, file, stat.nr_pageout, nr_scanned - nr_reclaimed); @@ -2178,10 +2178,10 @@ static void shrink_active_list(unsigned long nr_to_= scan, nr_activate =3D move_folios_to_lru(lruvec, &l_active); nr_deactivate =3D move_folios_to_lru(lruvec, &l_inactive); =20 - __count_vm_events(PGDEACTIVATE, nr_deactivate); + count_vm_events(PGDEACTIVATE, nr_deactivate); count_memcg_events(lruvec_memcg(lruvec), PGDEACTIVATE, nr_deactivate); =20 - __mod_node_page_state(pgdat, NR_ISOLATED_ANON + file, -nr_taken); + mod_node_page_state(pgdat, NR_ISOLATED_ANON + file, -nr_taken); =20 lru_note_cost_unlock_irq(lruvec, file, 0, nr_rotated); trace_mm_vmscan_lru_shrink_active(pgdat->node_id, nr_taken, nr_activate, @@ -4757,9 +4757,9 @@ static int evict_folios(unsigned long nr_to_scan, str= uct lruvec *lruvec, =20 item =3D PGSTEAL_KSWAPD + reclaimer_offset(sc); if (!cgroup_reclaim(sc)) - __count_vm_events(item, reclaimed); + count_vm_events(item, reclaimed); count_memcg_events(memcg, item, reclaimed); - __count_vm_events(PGSTEAL_ANON + type, reclaimed); + count_vm_events(PGSTEAL_ANON + type, reclaimed); =20 spin_unlock_irq(&lruvec->lru_lock); =20 --=20 2.20.1