From nobody Mon Apr 6 18:56:34 2026 Received: from SHSQR01.spreadtrum.com (unknown [222.66.158.135]) (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 A4E0E3921E4 for ; Wed, 18 Mar 2026 09:07:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=222.66.158.135 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773824858; cv=none; b=Cn9GkpXkezBVsIUq7lbXCdkuhjKswpwn2F8ajSp1GJTDiYrBP9cNFtcMHfSwtmV2cajO0E9EiptJCyGPK2pc6LE/f7y7mcvDuA5XEi5SDbepcUZhrCWe2Rcc0KNzFgvollpSmH1azKoJxyUuMvLp20CbfnFlypxiWp/MJM7ysNE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773824858; c=relaxed/simple; bh=sAk0ghsKv6Dvur4cvwKtv8n3ZVj6CGVu0JE/0GvUKJo=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=IuEPGyXxT8WYupSv/impKm41puNI8K3QBH4KXFDc8/gZ0br7VzTUe8scKwnZO9vgeiXrNsv6qeYu554Cn1CezRNGE/L+0dymud8jX2d87PllRsm7fRz4MP3MX4lDWekUVqYyvKGiRsvu14ZWV7Kas+0VYXX9OuNmKZ+JFISYt+0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=unisoc.com; spf=pass smtp.mailfrom=unisoc.com; dkim=pass (2048-bit key) header.d=unisoc.com header.i=@unisoc.com header.b=FvGN5JM3; arc=none smtp.client-ip=222.66.158.135 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=unisoc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=unisoc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=unisoc.com header.i=@unisoc.com header.b="FvGN5JM3" Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTP id 62I9778V062842; Wed, 18 Mar 2026 17:07:07 +0800 (+08) (envelope-from zhaoyang.huang@unisoc.com) Received: from SHDLP.spreadtrum.com (BJMBX01.spreadtrum.com [10.0.64.7]) by dlp.unisoc.com (SkyGuard) with ESMTPS id 4fbNG92rCDz2PGnwH; Wed, 18 Mar 2026 17:05:37 +0800 (CST) Received: from bj03382pcu03.spreadtrum.com (10.0.73.40) by BJMBX01.spreadtrum.com (10.0.64.7) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 18 Mar 2026 17:07:04 +0800 From: "zhaoyang.huang" To: Andrew Morton , Axel Rasmussen , Yuanchu Xie , Wei Xu , Johannes Weiner , David Hildenbrand , Michal Hocko , Qi Zheng , Matthew Wilcox , , , Zhaoyang Huang , Subject: [PATCH] mm: skip dirty file folios during isolation Date: Wed, 18 Mar 2026 17:06:56 +0800 Message-ID: <20260318090656.1748509-1-zhaoyang.huang@unisoc.com> X-Mailer: git-send-email 2.25.1 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-ClientProxiedBy: SHCAS03.spreadtrum.com (10.0.1.207) To BJMBX01.spreadtrum.com (10.0.64.7) X-MAIL: SHSQR01.spreadtrum.com 62I9778V062842 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unisoc.com; s=default; t=1773824851; bh=Bw+j2EthuoNgAdy4WkrHKYeKPDOSVmy7VPuUpiShHc4=; h=From:To:Subject:Date; b=FvGN5JM33Mg7aSWxD6tIwBvBDR01T2ReejqXl2gcfWCfkueVHtLEgy9ZLXnSI8uw7 HcmgHtwLoc/S5aIB7IiuQ/7pYICH4/cHUvzy0CarItO99fGyvKvx6ePTWYdxYRz7YL z3IgrHhjx+9xuLyugp2Qe7FVdbRcZ0QMrNoYeOaDgaXj0ZdrpT16eGDMUKdDgw+NoK A7ixq92Nt8r0M6efvS34nftmrWeMwPwqpd6nkGbNKNm8x6t2319q6I7Rlu93SRbgzM +l4C2qMrzyzMofRp/N2ZJEJtMd5o7Coacsp1btcoIccDtBG2Rdd4G/lUaLzgaiH6qj /NHOQcs9pjc+w== Content-Type: text/plain; charset="utf-8" From: Zhaoyang Huang Since dirty file folios are no longer writeout in reclaiming after 'commit 84798514db50 ("mm: Remove swap_writepage() and shmem_writepage()")', there is no need to isolate them from LRU which could help to improve the scan efficiency. Signed-off-by: Zhaoyang Huang --- mm/vmscan.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mm/vmscan.c b/mm/vmscan.c index 10f1e7d716ca..3a029dede5ce 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -4507,6 +4507,7 @@ static bool sort_folio(struct lruvec *lruvec, struct = folio *folio, struct scan_c static bool isolate_folio(struct lruvec *lruvec, struct folio *folio, stru= ct scan_control *sc) { bool success; + struct address_space *mapping =3D folio_mapping(folio); =20 /* swap constrained */ if (!(sc->gfp_mask & __GFP_IO) && @@ -4514,6 +4515,11 @@ static bool isolate_folio(struct lruvec *lruvec, str= uct folio *folio, struct sca (folio_test_anon(folio) && !folio_test_swapcache(folio)))) return false; =20 + /* skip dirty file pages since they can't be writeout */ + if (mapping && !shmem_mapping(mapping) && + !folio_test_anon(folio) && folio_test_dirty(folio)) + return false; + /* raced with release_pages() */ if (!folio_try_get(folio)) return false; --=20 2.25.1