From nobody Thu Apr 9 12:09:33 2026 Received: from SHSQR01.spreadtrum.com (mx1.unisoc.com [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 8BB1F28314B for ; Fri, 27 Feb 2026 07:56:57 +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=1772179021; cv=none; b=SL7bCM2nWwrvS/BjqIy+VCMvl2hi08jiY4Pop1HhORw+/amzUSHuVioJKjjFdI8BwV7QGgkEHCS+iD8tdVpD2apTFcgnRTPoE6yJ+nbenzly9h5nbRyH4VvEqMMnODiESJJjesLAJBHUNq1OQQMN9pyLXN0Jja7gxj5CKvf7XuA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772179021; c=relaxed/simple; bh=jebXHgyhszRjQ444CIN9AR/8ou+WMcirpNEmYnzX3fY=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=HlEOeFxz0/ixxVX5UFPF1LKlmOYk4Lj5+OEdzveG41n1CL7nlbG62joZG9MSq/lAv/mNOLNU6oBXVRfBI7TuHUyrWDSG6LzL7H3F4SEq8JHc1ZNKLphLYbsLv2VAM949CocGluHXFFriA2ZtFhJsDxG3tDX51Ny5Lb4y4Sf4E6g= 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=LYhVInJ9; 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="LYhVInJ9" Received: from SHSQR01.spreadtrum.com (localhost [127.0.0.2] (may be forged)) by SHSQR01.spreadtrum.com with ESMTP id 61R7usFV037256 for ; Fri, 27 Feb 2026 15:56:54 +0800 (+08) (envelope-from zhaoyang.huang@unisoc.com) Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTP id 61R7r4ij010189; Fri, 27 Feb 2026 15:53:04 +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 4fMgXF4db3z2P5pqq; Fri, 27 Feb 2026 15:52:13 +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; Fri, 27 Feb 2026 15:53:02 +0800 From: "zhaoyang.huang" To: Andrew Morton , Yu Zhao , , , Zhaoyang Huang , Subject: [PATCH] mm: bail out when the PMD has been set in bloom filter Date: Fri, 27 Feb 2026 15:52:50 +0800 Message-ID: <20260227075250.1128175-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 61R7r4ij010189 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unisoc.com; s=default; t=1772178797; bh=2QQxJgo2nTQ+Zw3Bf081QKEft/GBg6KAyskkWtN3Ze4=; h=From:To:Subject:Date; b=LYhVInJ9Malc6NILuWxejbXJ5GxewAQlHfOA6+1Af3L7l6159yOr47zzBxe5MWJjU CUPiuazfvVR2c28Rx5zy+x+vjpDxxmYNy4+4xaztPl0NkxWdWDBgo20NMaHx2zI45Y VE7NnvUEtS80jNYhKoC0g/2azoRFSr/PBLGk9QIrBGkXtZv3nFM8TjDLPKxJy1mmq/ fKbj3gKpZTZ8Fy592zo7Ft5iPlWgnsIYhGlvO2PJonP2l+a4Yqf2+PEqDf7HVqXJXJ n+0fr77rnZIqKMtk46WIzaLjozZ7lB0SjTZ02xFdoYDMG0daV9bz4IfUzflevvwxF3 2LXaHN2DBR9Fg== Content-Type: text/plain; charset="utf-8" From: Zhaoyang Huang There are two reasons to have the recorded PMD bail out from doing the following iteration 1. It is worth of doing such a trade off thing in terms of reclaiming efficiency as test_bloom_filter only consume 20~30 instructions in modern processors(25 instructions in ARM64). 2. The PMD needs to accumulate young pages until aging happens while the new arrived folio reference checking under current max_seq refuse to do so which will affect carrying hot PMDs to new generation. Signed-off-by: Zhaoyang Huang --- mm/vmscan.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mm/vmscan.c b/mm/vmscan.c index 9d900be478ea..e50e98291d0d 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -4227,6 +4227,10 @@ bool lru_gen_look_around(struct page_vma_mapped_walk= *pvmw) /* avoid taking the LRU lock under the PTL when possible */ walk =3D current->reclaim_state ? current->reclaim_state->mm_walk : NULL; =20 + /* may the pmd has been set in bloom filter */ + if (test_bloom_filter(mm_state, max_seq, pvmw->pmd)) + return true; + start =3D max(addr & PMD_MASK, vma->vm_start); end =3D min(addr | ~PMD_MASK, vma->vm_end - 1) + 1; =20 --=20 2.25.1