From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mta0.migadu.com (out-191.mta0.migadu.com [91.218.175.191]) (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 8881A2F39C2 for ; Mon, 24 Aug 2026 03:26:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.191 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787542004; cv=none; b=Bwbj9ENKjyq2bXogHNSTWTaFpz4++RE8faKEQ8sIh5i869joEULCijD5TMmpwCdRrqYrGM4slAdc4l4asstycILj48W7Bb8vfUhLpKJeTDxjfGKPpbIk95xdbdK0z2zKSDbLzqWQOxTbp0LZXCrg8KTgZDIFHcRzM/+bFIPZDxw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787542004; c=relaxed/simple; bh=MOX0Kef8fkPVgmc1F6WgB5gerRrRmBlU8NrSsDREIvE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Sb/G22vj9SWrvNMFePPzRnzkINuS9lAAQt9iXuxHRw/V88kgiRfcEMTIhk6F/uGjkLHhtgJp40op0uz38vuv4XFjWKNgVuQ1xIm1pP54lq4ah1XtXgwjFDS3Bp2x2noDxQJuvnHwvUgItpVWSJ0mg/R6oj9cdaaC/zePX2G6qlY= 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=WxR77WXS; arc=none smtp.client-ip=91.218.175.191 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="WxR77WXS" X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=MOX0Kef8fkPVgmc1F6WgB5gerRrRmBlU8NrSsDREIvE=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1787542000; v=1; x=1788146800; b=WxR77WXSkt+SDL5wu0Ayd8GKgKs2rnZFdjbgDWG1dio8yYg6r7c+8kjzUXSYOfqxMufvoNzj u9y9s6SPq9Yki/Ju+UxCJvzQ1Sy6HZRTdE4yKaizHmEWj+NfmK1h/+BB7UAqAkBMA1lymdpI4mP Hm+AzkQCAr8sjPz+JHZyhgQU= X-Envelope-To: linux-kernel@vger.kernel.org Received: from [10.63.107.123] (14.29.108.92) by smtp.migadu.com with ESMTPS id f18e9b341d3c2d76; Mon, 24 Aug 2026 03:26:40 +0000 X-Mizu-Trace-ID: f18e9b341d3c2d76 X-Migadu-Flow: FLOW_OUT Message-ID: <6e17bee1-74b8-4d1e-b94e-54c30e945bc5@linux.dev> Date: Mon, 24 Aug 2026 11:26:28 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH 3/4] mm/vmscan: drop the combined limit gate in __node_reclaim() To: Johannes Weiner Cc: Andrew Morton , David Hildenbrand , Michal Hocko , Qi Zheng , Shakeel Butt , Lorenzo Stoakes , Kairui Song , Barry Song , Axel Rasmussen , Yuanchu Xie , Wei Xu , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Ridong Chen References: <20260821081741.1340277-1-ridong.chen@linux.dev> <20260821081741.1340277-4-ridong.chen@linux.dev> From: Ridong Chen In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 8/21/2026 8:49 PM, Johannes Weiner wrote: > On Fri, Aug 21, 2026 at 04:17:40PM +0800, Ridong Chen wrote: >> From: Ridong Chen >> >> __node_reclaim() only ran shrink_node() when unmapped page cache was >> over min_unmapped_pages OR reclaimable slab was over min_slab_pages. >> >> With slab and file reclaim now gated per type by sc->skip_slab_reclaim and >> sc->skip_file_reclaim, this combined gate is either redundant or harmful: >> >> - for the NUMA node reclaim caller it is always true, since >> node_reclaim() only calls in when at least one limit is exceeded; >> >> - for the per-node proactive reclaim caller (which does not go through >> node_reclaim()'s checks) it wrongly suppressed all reclaim -- anon >> included -- whenever both page cache and slab happened to sit at or >> below their limits, even with plenty of reclaimable anon present. >> >> Drop the gate and let the per-type flags decide what to reclaim. The >> node reclaim path is unchanged; the proactive path can now reclaim anon >> as requested. >> >> Assisted-by: Claude:claude-opus-4-8 >> Signed-off-by: Ridong Chen > > Could we go with this patch and table the rest of the series? > > These minimums are specifically for zone_reclaim_mode. I don't know > who is using that at this point, and it seems the behavior has been > like that for a while with no practical complaints. So my take is, > leave it until somebody has a real problem. > > Applying those limits to proactive reclaim, on the other hand, wasn't > intentional, isn't documented, and can lead to unexpected behavior - > considering we have non-zero default values on these knobs. > > Since the gate was already redundant for some reason, leaving it in > node_reclaim() (zone_reclaim_mode) and killing it in __node_reclaim() > (the path shared with proactive reclaim), like you did here, sounds > like the best way forward for now to me. > > With an updated changelog to that end, > > Acked-by: Johannes Weiner > Thanks. Will update. >> --- >> mm/vmscan.c | 20 ++++++++++---------- >> 1 file changed, 10 insertions(+), 10 deletions(-) >> >> diff --git a/mm/vmscan.c b/mm/vmscan.c >> index 1e56973ceb73..5a3f67b3ba32 100644 >> --- a/mm/vmscan.c >> +++ b/mm/vmscan.c >> @@ -7906,16 +7906,16 @@ static unsigned long __node_reclaim(struct pglist_data *pgdat, >> noreclaim_flag = memalloc_noreclaim_save(); >> set_task_reclaim_state(p, &sc->reclaim_state); >> >> - if (node_pagecache_reclaimable(pgdat) > pgdat->min_unmapped_pages || >> - node_page_state_pages(pgdat, NR_SLAB_RECLAIMABLE_B) > pgdat->min_slab_pages) { >> - /* >> - * Free memory by calling shrink node with increasing >> - * priorities until we have enough memory freed. >> - */ >> - do { >> - shrink_node(pgdat, sc); >> - } while (sc->nr_reclaimed < nr_pages && --sc->priority >= 0); >> - } >> + /* >> + * Free memory by calling shrink node with increasing >> + * priorities until we have enough memory freed. > > Might as well drop this comment. It just says what the code does. > >> + * >> + * What to reclaim is gated per type by sc->skip_slab_reclaim and >> + * sc->skip_file_reclaim. >> + */ >> + do { >> + shrink_node(pgdat, sc); >> + } while (sc->nr_reclaimed < nr_pages && --sc->priority >= 0); >> >> set_task_reclaim_state(p, NULL); >> memalloc_noreclaim_restore(noreclaim_flag); -- Best regards Ridong