From nobody Mon Feb 9 20:31:48 2026 Received: from out-186.mta0.migadu.com (out-186.mta0.migadu.com [91.218.175.186]) (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 E504739448C; Wed, 14 Jan 2026 11:28:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.186 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768390090; cv=none; b=cAumc0U86jeMyQN8r9a3dTZJnreMGg2dhSz31nIZjxF4lMQYogSO2Fv3GwqHr5XlGpEOuVKB/+5ZAZbn9PfvL8J1wEHVp26njOo7UouOTcXGaoJUbyV9zA0bA1CYvYpOY+f961CF4g7SPNv0/z+bLzZNZx6ue0oZ9i+8jmzJ8w4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768390090; c=relaxed/simple; bh=OMOWpi4mByl/2kwdVpihtrW4+CoUpVerfWepNotOqKQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ILIWHFfTazhP04znQqB9V4nA7C0JrhN3vPcp+UPLfqJjf+CoDTSNoh9W86FiVLoPNdf/vEtT4MTy3rUGKpJaI+FR4WwZ/e8ZscoFLKAMrVlflU4cC94JWtn+MBWXsd+L1zJZdmdJwL9Ftdc//9xXWNUfQW4W3Y1q07UxNpxvZYw= 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=AdVzvqBm; arc=none smtp.client-ip=91.218.175.186 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="AdVzvqBm" 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=1768390087; 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=qomE5HnihpcoHBR2vFUHdVECzXWs6li/sJdmccqo5Bc=; b=AdVzvqBmYS1dL36VtYJHqvTy71Jc8fzRL8QUahKoKOYiZ5QwB+I/tujZElmvvEDzP4p4Ec 20O6pXYm+Q9sDcASfLFnLKmosjocC1UFlDSNKk8KAmRj3BSlS5kIx4LR8JEPN+bxDIBDFL FZnP/P9i4pLe5YhVfj/OvVaMc8MVcvY= 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 Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, Qi Zheng , Chen Ridong Subject: [PATCH v3 04/30] mm: vmscan: prepare for the refactoring the move_folios_to_lru() Date: Wed, 14 Jan 2026 19:26:47 +0800 Message-ID: <65187d0371e692e52f14ed7b80cf95e8f15d7a7d.1768389889.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 Acked-by: Muchun Song Reviewed-by: Harry Yoo --- mm/vmscan.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 1ede4f23b9a6f..5c59c275c4463 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -2045,12 +2045,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); @@ -2195,10 +2195,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, @@ -4788,9 +4788,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