From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f44.google.com (mail-qv1-f44.google.com [209.85.219.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B2BA92561A7 for ; Sun, 1 Mar 2026 06:14:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772345694; cv=none; b=YF6YU2M+JjJ+z7pOnnrcvsebLvg5uMzj4hM3DfT/uZAHI0mN7s6fg2FtMiFotB4WO61UxZBqt7spairrDo1US7FRlcOGaGVAeZ0QzuEZ14rKFgCtHfDr1T1ffjiB7VeAzy2hNfBJFq6ahrSmJuoxtczx8Xct5EvG+bfwIgfyOvk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772345694; c=relaxed/simple; bh=TvM2pCIoe5azxkoi6YrdeleRTbyRjXebFgLsNd2aQfY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ac7+FE2ekH3yGngjpYk9TlVpum1yUWpeMc6vjhLHSfgNgsF/oBCMQeuZQRQ5T9o5VTmNivJBBpA53k4pB2KXcyIPTiWgdlqKAU7WWEUGKb0lI9lsyBHNyl6e/TrIJGJopgRnda7f2r9mEGsq2TDFCbnEAskBIZUuKJvkKY0s7h4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net; spf=pass smtp.mailfrom=gourry.net; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b=qnaJLEvs; arc=none smtp.client-ip=209.85.219.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gourry.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b="qnaJLEvs" Received: by mail-qv1-f44.google.com with SMTP id 6a1803df08f44-897023602b1so46360566d6.0 for ; Sat, 28 Feb 2026 22:14:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1772345691; x=1772950491; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=8SxXckReq+HlnydNzXLK+XIbpIQhFrUUR6NTgAKyiaM=; b=qnaJLEvssKzssUuchXd9dhT8scoBWuZUtHM5yx4CrYJltRSodF8/rQfDQafWBKGtQm AlyH9hBY+u99IVtGvh1MsGmJTd3P+0mwCvuaci6Szh/Q5prd010Ga51xdDfAzcyzYn2u 99Lt7xuRv4NOPOawTzl5To6Ye3CM2dGsOyp25Zh3ChyotZkWwL59VOb6gRb0bFsx+z4c T7ocBrKcpisEkXvQOR+0PPKCVaChr1JKK2lkqFUAHcSXJslkUYJpUYv/sDtUdKy9ls7k J+SeXSWRdCpQ09UKDru5J1ZP+oN/QZHVY8SwWngIMGPSogVvVBbsnXGeLl0iONVC5/6v DFmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772345691; x=1772950491; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8SxXckReq+HlnydNzXLK+XIbpIQhFrUUR6NTgAKyiaM=; b=VuvsTEarAMtINMug6aOG3V4r4AXa2/GSuuU89fUVYwxaE4yPCaoMvRJxFr1xebFmQa G81zd/okpHuQnhR/yrz903YEM4mscDTrTgo/Qhry+eFXBOE5huJWounoSKq5CxOaBfwu blJsEBg8DnO9dW2SIhN3nH/fmqlMS3mlTEqcREjrSHEbn0q0GVzZnqUBOvbtHiErHOrg r7oGNvTlhwlHhF3RKK0dgFkyvOyrR2JjOdP94yNy8i+89gINzU1twynKO7C12Ju5E4yh vJoVJc8DZeDSHMJq56cuUL2EpoOUFWzr7HCtUkzeJ+Du0jjgk31+eTmuFTerzhxFhkGC zm3A== X-Forwarded-Encrypted: i=1; AJvYcCV3WkbjqM+gHxlY1KX27J9V/HMVPM+lIDq0jmxx/x/i2vyhxpSGtYqU77LvSeltgrTPT5R1EQtyIhiJvDQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yy3GO0GweZ0naBdDEccjGZ4yK3BqRwCyxbigIqhlkqyloRpxNs9 14pDZ0TkTDP32MwlA0w+5QikjkZwFM+6YDHtc857MiN/ERKgSDLj62dzchiZmzZDYJ4= X-Gm-Gg: ATEYQzwes+EIOuMYmqDtPEA6xCkKGu9kOhd2zwXNFQFU8nzZjRWWhsAywREPm0LAi+n ElmuYNA8U8hvMoaNrlAUHnBOKM04gwGBSWncLBJPQuPzFrP7EZ/SUui0MJaMsC3CyEOHLGKkP3y eczSPu4xmxbkz0gIACK0pRn+nL372P3I/ykOKn0tfPzaPW7lJxVVP66xeTWZWVwXzRMCb8Mxv1C 1MYHtyNeSWsDFOX+7VQkP4C52Wu1nbhL2vpA9HzPpTJSAdmcatKTHDrYpsDS9qwO/Pr9qb91SdT fwmJzfENKs0NekPVi5OF/wWPOsi1lNcOYdYPqNINYBWmRMr8UIsb/VLB6fGZEjzUEL8XaVDG+XM TAY5uVosfBe1BSozfUhVUDH/M4WILO8es8BYfMfvppLho9SV6+uJtpeGzuwC2lkDjL+68M1lfVU N8ktWjXo2UH2FTeZ2A8vc+Cp2BnaHtJwb/xHocOa2Kii9YVHvICI6+oMWwZpHMlUguEc5Hayg5y qs02w++VA== X-Received: by 2002:a05:6214:230b:b0:899:ac2b:6ddc with SMTP id 6a1803df08f44-899d1e6e8c9mr125086616d6.62.1772345691490; Sat, 28 Feb 2026 22:14:51 -0800 (PST) Received: from gourry-fedora-PF4VCD3F (pool-96-255-20-138.washdc.ftas.verizon.net. [96.255.20.138]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-899c7376732sm77099556d6.24.2026.02.28.22.14.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Feb 2026 22:14:51 -0800 (PST) Date: Sun, 1 Mar 2026 01:14:48 -0500 From: Gregory Price To: "zhaoyang.huang" Cc: Andrew Morton , Yu Zhao , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Zhaoyang Huang , steve.kang@unisoc.com Subject: Re: [PATCH] mm: bail out when the PMD has been set in bloom filter Message-ID: References: <20260227075250.1128175-1-zhaoyang.huang@unisoc.com> 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=us-ascii Content-Disposition: inline In-Reply-To: <20260227075250.1128175-1-zhaoyang.huang@unisoc.com> On Fri, Feb 27, 2026 at 03:52:50PM +0800, zhaoyang.huang wrote: > 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. > Can you explain what the intended *effect* of this patch is? Why does the PMD need to accumulate young pages? Why does this patch help that? How does this affect carrying hot PMDs to the new generation? What concrete behavior did you see before this patch, and how does this patch change that behavior? What is the user-facing effects before / after this patch? Is this fixing a bug or a tweak to the MGLRU heuristics? ~Gregory > 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 = current->reclaim_state ? current->reclaim_state->mm_walk : NULL; > > + /* may the pmd has been set in bloom filter */ > + if (test_bloom_filter(mm_state, max_seq, pvmw->pmd)) > + return true; > + > start = max(addr & PMD_MASK, vma->vm_start); > end = min(addr | ~PMD_MASK, vma->vm_end - 1) + 1; > > -- > 2.25.1 >