From nobody Mon Apr 6 23:14:03 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 059D93F8815 for ; Tue, 17 Mar 2026 19:11:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773774707; cv=none; b=p45ftibdHQcwUuEMIpo3ats3AUn+lB7n2o60KfefQrQ6NrGiSZMLAHR/bDgI99ton+mHf2bw5jKEvyAFmEe8BZRFSnWxkJofy70XDt35RX9YT4lldzCJtECjBAkVZMVyil1vEflZc2DME58ZppF/05V4hsntQtjd4pEu6Tu+liQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773774707; c=relaxed/simple; bh=6I1+6vrVieFNvUiP+TJuhWEsMy3QD5/7Cm7KDDyN1YY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=LQvOAcO356A/00Uz8A43ckZyfp3LP31immcKsY7pL2GFtreZLFRH2ARxPg1BlvloLJV+pKerfnBsn+K01nfHF3qIeKdAJDFp47G7/MRBojjez+GarJMizB+ohNlx972z0msz4jsOzCJLZiWqrrZOUVbTS5+lAf/09J5YPnKWn7c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dBfbUwkn; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dBfbUwkn" Received: by smtp.kernel.org (Postfix) with ESMTPS id BA01FC2BCB8; Tue, 17 Mar 2026 19:11:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773774706; bh=6I1+6vrVieFNvUiP+TJuhWEsMy3QD5/7Cm7KDDyN1YY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=dBfbUwknzmkckPZFviQuzYRJZOq8JaznvJ5EufhMR8+v2jfiNq1RreBYulAgDJMG6 2WGlcvfe5lK95OONzAm/odo45LjDHAv+PL2uiyJsBp+TXRvR76SV8btr+pn6KxpYP/ PUIfs9dPEuvcALysf0bbAPwpWYrjyBuN2wN5AgH0OHuAR4OFM9XoyxBDRAyDQ2s31c JYbM+55c9P92rNWMCQAAug3Pc+oDJ/wvIODYi3hbMdp+tKv7px3c5xENJNxIF1ysmV usZZqoTJdqrqFBIWa3ArxHjqAez4eCqyJFRBa1szBc5zI7E5CetUbNWkSXC4U6cWKO yl8Yr+y/Qz8wA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id B01C0FEDA16; Tue, 17 Mar 2026 19:11:46 +0000 (UTC) From: Kairui Song via B4 Relay Date: Wed, 18 Mar 2026 03:09:01 +0800 Subject: [PATCH 5/8] mm/mglru: use a smaller batch for reclaim Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260318-mglru-reclaim-v1-5-2c46f9eb0508@tencent.com> References: <20260318-mglru-reclaim-v1-0-2c46f9eb0508@tencent.com> In-Reply-To: <20260318-mglru-reclaim-v1-0-2c46f9eb0508@tencent.com> To: linux-mm@kvack.org Cc: Andrew Morton , Axel Rasmussen , Yuanchu Xie , Wei Xu , Johannes Weiner , David Hildenbrand , Michal Hocko , Qi Zheng , Shakeel Butt , Lorenzo Stoakes , Barry Song , David Stevens , Chen Ridong , Leno Hou , Yafang Shao , Yu Zhao , Zicheng Wang , Kalesh Singh , Suren Baghdasaryan , Chris Li , Vernon Yang , linux-kernel@vger.kernel.org, Kairui Song X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1773774704; l=825; i=kasong@tencent.com; s=kasong-sign-tencent; h=from:subject:message-id; bh=WP4y9XHEWiYUb4a2CJWiS80eKSpma8CkjsOc7bozYm0=; b=g31dIkTIDAoe+MBcN4ZK5LGx2nUUlTr1S9ZIEF3qT1RdprPhYqv5TpzL2bTnSn2S22d/15tG8 vcDdYbsDHYuD00RXl3abh+rRm7IHz5euwoqKW53MVDa4YC3BLrm/HqQ X-Developer-Key: i=kasong@tencent.com; a=ed25519; pk=kCdoBuwrYph+KrkJnrr7Sm1pwwhGDdZKcKrqiK8Y1mI= X-Endpoint-Received: by B4 Relay for kasong@tencent.com/kasong-sign-tencent with auth_id=562 X-Original-From: Kairui Song Reply-To: kasong@tencent.com From: Kairui Song With a fixed number to reclaim calculated at the beginning, making each following step smaller should reduce the lock contention and avoid over-aggressive reclaim of folios, as it will abort earlier when the number of folios to be reclaimed is reached. Signed-off-by: Kairui Song Reviewed-by: Axel Rasmussen Reviewed-by: Chen Ridong --- mm/vmscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 4f4548ff3a17..2ff1609ff4de 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -5007,7 +5007,7 @@ static bool try_to_shrink_lruvec(struct lruvec *lruve= c, struct scan_control *sc) break; } =20 - nr_batch =3D min(nr_to_scan, MAX_LRU_BATCH); + nr_batch =3D min(nr_to_scan, MIN_LRU_BATCH); delta =3D evict_folios(nr_batch, lruvec, sc, swappiness); if (!delta) break; --=20 2.53.0