From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f173.google.com (mail-qt1-f173.google.com [209.85.160.173]) (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 903D1357CEA for ; Fri, 21 Aug 2026 12:50:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787316606; cv=none; b=VY3I7n107q/TQVYEiZb2lGcfZbcUlp4xp4lTBZixBpS+2ePxZV2RnATM8yFbV0JFtUXaxO7OFeCh7m7oeiCrIWXWXx392bmVMQGkJCDwa4+250cHYKSNNlR3ohBdJ7cQWhRHhZhuRuTpy9RNrReJbyWtxxWgwgkMVDFeDchPy7g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787316606; c=relaxed/simple; bh=Uyht8F/YynCqaZBEkdBiS8I08ABLCaQFMDa/+ZPv7Pc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GzM5x2knIkw7iY3d86nBzdMXudjOlvHJ+Ld/BFbFnrVJUylvpjHFDqxPu28x7nL3HkWCDRhxoYQdXdu5dMrfAEQtEOOVujQ5WC1/u53Z5o43fkKc/wPCJtzeftvR9CyUNb1iG1GWa27DQTAQ/yNWaht68ydL22bK2gbBFMm442Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmpxchg.org; spf=pass smtp.mailfrom=cmpxchg.org; dkim=pass (2048-bit key) header.d=cmpxchg.org header.i=@cmpxchg.org header.b=m6AjcCvs; arc=none smtp.client-ip=209.85.160.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmpxchg.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cmpxchg.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cmpxchg.org header.i=@cmpxchg.org header.b="m6AjcCvs" Received: by mail-qt1-f173.google.com with SMTP id d75a77b69052e-51c04bf4711so8054501cf.2 for ; Fri, 21 Aug 2026 05:50:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg.org; s=google; t=1787316602; x=1787921402; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=Fhro7MxrmdtRID/n94E3pPhgJ57IS7qKaNzNOptQ1Mg=; b=m6AjcCvsTCfszqpYXlu5zRDvGfBgLwa+0tWZhdErrfbCXZ3lh+qH1X36J/mB4NpANL CuAqEcI14gDsk+2KrEpu5fn9TpJpwUqR78hvMOTqlI2x0MlbYMvttuwPyOByh4YN7k4w XS7yUIjuheMqRmULNgDDyErJAUEpWDoa7EPurOBnOS8iUJbODr86XqwkdcxPdEYj8wo3 ROOX00Ukzi1h28JrnAz6wxDr3zxhFlr7R1s6+ARu/RgbvASL8fGzK71J4gdXoPc21InQ hfR6I30PQ/LsGtPQgThRL8tVHP4bSzw6jKClBpDnq7luHmdlOyE2kJED35Wo+0w14mRJ gmCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787316602; x=1787921402; h=in-reply-to:content-disposition:content-type: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 :content-type; bh=Fhro7MxrmdtRID/n94E3pPhgJ57IS7qKaNzNOptQ1Mg=; b=PYQnGRu6c2Wxxr1zvNA6YI1giu2diNAu5MTiAz1DOND0QKQ8yEG0Oib73ypb3lqKu8 0BY78Cy/uJacN57PwE+8hO8ABFh/m3bOjQaRVYrMisI2EVB1B3m8V1lcVWTXuqPo9UrQ zXQbf3fXEWSn4MucK9K3e0Q8snhQPc2+JUYZWBwVgeG+VPtDlIf68CCemPxyz8R3KmH/ ibt+M7c5WVyskmQYpacBsDKrXtwSWnuPPPA8VltMBDGVILbxb/ArODL3g6QX2jNciGSz VK/3VwXyuFiufGVnwFxMxgizoLuNtC9DJY/S3BvxNxtfSu5WP7F8W7KsjKGa6GppO+wp bGkw== X-Forwarded-Encrypted: i=1; AHgh+Rrcf69LeAZQRS5NM6dJfyNd1C7Fn1OxwBWCgFO/QblnGW52LOkfHqgUUn1otyAhwO/Epg6fwUX/zOH7HjI=@vger.kernel.org X-Gm-Message-State: AOJu0YxHHwGNkaXlOqAg6pxGjNzkWeSLoIH2vftkV7+48Rf/nc1inQsd CbRfDjHZDxAwB9RpMrq/a2xmlTSu029TnL7VfG+OQ5ebEU9gzvmYZ7oROn4O58QFpFQ= X-Gm-Gg: AR+sD135oAD4+yDgE9gpBGtr3TGzcTL7WYqcNigvXa0NtuFF14e+3yojjmxTeeN5kzP 5Qn7LCLa00uYjxu3s5ltRUheKTM/R/CUhuioo8MrxVRxvQddRhQjn6C6SBRXg3Vl5lNcSuGkcBo VVvjK88FUhHtYWK3iTphT/6f5tFXZrGPFF7Gj+jR5Y7jOmbrCqz3dqP4GShN3qeMTlkbkbtWv8p /1xG83AF9HtKaM5Uz7h656rr15KYW+qWwDz+QnoGaERUjo19b8q206h/Z8FHaMYcFqTFX5nfg/q lDtqasrHCJHZH3autQE2L5TxDJ8In6gAhNo/UsyoVqabTyOKmtCna9FKkS9JCPdX7pri4YNfPnI CgM0N+OkqmlTkoBcIQSx85duamTa6yX7DOSWv5+o3PTvzllNVDVKYCO44Ov4q6SlAsOcCB0BhkZ l//zgBZ5P9wK/MZZ78FMkz5l58KUGrX/a/XFBY8YSMQuc9TDXgcBdL/9qjhwg= X-Received: by 2002:a05:622a:2305:b0:51c:849b:86b with SMTP id d75a77b69052e-52df5ba9d6fmr52365311cf.43.1787316602046; Fri, 21 Aug 2026 05:50:02 -0700 (PDT) Received: from localhost ([2603:7001:f100:500:365a:60ff:fe62:ff29]) by smtp.gmail.com with ESMTPSA id af79cd13be357-93720493f05sm578788685a.6.2026.08.21.05.50.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Aug 2026 05:50:01 -0700 (PDT) Date: Fri, 21 Aug 2026 08:49:57 -0400 From: Johannes Weiner To: Ridong Chen 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 Subject: Re: [RFC PATCH 3/4] mm/vmscan: drop the combined limit gate in __node_reclaim() Message-ID: References: <20260821081741.1340277-1-ridong.chen@linux.dev> <20260821081741.1340277-4-ridong.chen@linux.dev> 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: <20260821081741.1340277-4-ridong.chen@linux.dev> 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 > --- > 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);