From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mta1.migadu.com (out-28.mta1.migadu.com [95.215.58.28]) (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 CB97739478C for ; Fri, 21 Aug 2026 08:17:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.28 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787300229; cv=none; b=mJyRXUVzmpn8iuVci37zLnSxdcZm1wWr4Ol8UNHpqlq4GAGK2UDXw8RZkdIXCEkLzrtbp2jimrQFM6LAcE2ncNwmkd/CfisB94VKFkcKBjxuFkdLXGc2BG0jROWiLYi3EhJ4gx2A09Xw4j+R6PYW6wya6XcGs2254JUv2/s0zL8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787300229; c=relaxed/simple; bh=q2LBYSGl4npt3b/U4TgoApNxg/auAjLyjB3dvIGUVCE=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=kxI3eJDEu826b+0d0YH/Smgin6R9JCqA7+NzPbQn1Jg/WFljrb+2J2DnaH8LLHfG+qYNKDv08Jw0N88pgCjL1c7opCudfYtHkzZi6xcNlqmKiacI2exelH6F2zMx6h+02M0ZNH2B5NUHCmjt3ExOM9LrTCx5pqvvrygqGxpGQ6I= 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=cUmc+fz8; arc=none smtp.client-ip=95.215.58.28 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="cUmc+fz8" X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=q2LBYSGl4npt3b/U4TgoApNxg/auAjLyjB3dvIGUVCE=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1787300223; v=1; x=1787905023; b=cUmc+fz82tugVoetyXSen4TEtmnnwPbkouT5HPb1dverA6M4l2vjOLiFk1tA1L1QenIb7yIb 7wIgr+FcleAigkH8QpXmtu7FtT/BNHSx9oxhZge4qWM4E5o0634f8ZHi68rtsxQSz7wdveYofXT NDMaotyeh9mPBzgR4R4wds1s= X-Envelope-To: linux-kernel@vger.kernel.org Received: from mi-ThinkCentre-M760t.mioffice.cn (14.29.108.92) by smtp.migadu.com with ESMTPS id 487007466bb3646c; Fri, 21 Aug 2026 08:17:03 +0000 X-Mizu-Trace-ID: 487007466bb3646c X-Migadu-Flow: FLOW_OUT From: Ridong Chen To: Andrew Morton , Johannes Weiner Cc: 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 , Ridong Chen Subject: [RFC PATCH 0/4] mm/vmscan: honour node reclaim limits per type Date: Fri, 21 Aug 2026 16:16:37 +0800 Message-Id: <20260821081641.1339788-1-ridong.chen@linux.dev> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Ridong Chen min_unmapped_pages and min_slab_pages are documented as per-type limits, but node reclaim treats them as one combined gate: once either is exceeded, shrink_node() reclaims slab, file and anon together and pushes the other type below its limit. Per-node proactive reclaim reuses the same gate and fares worse -- with page cache and slab both under their limits it reclaims nothing and returns -EAGAIN on an anon-heavy node [1]. This series gates each type separately via two scan_control flags (skip_slab_reclaim, skip_file_reclaim) set only on the node reclaim path, drops the combined gate, and extends node_reclaim()'s early bail to check anon. The flags default to zero, so kswapd, direct, memcg and drop_caches are unaffected. Tested on QEMU (x86_64, 2 NUMA nodes), A/B kernels differing only in this series. Proactive reclaim (echo to node/reclaim) on an anon-heavy node, file and slab under their limits: metric before after ----------------- ------ ----------- pages reclaimed 0 MiB 254 MiB anon return value -EAGAIN 0 Node reclaim (zone_reclaim_mode) with one type under its limit -- the type under its limit must be left alone: type under limit before after ----------------- ------------- -------- slab 645 scans 0 scans page cache 83 MiB scanned 0 MiB [1] https://sashiko.dev/#/patchset/20260723045718.2052070-1-ridong.chen@linux.dev Ridong Chen (4): mm/vmscan: only reclaim slab in node reclaim when over min_slab_pages mm/vmscan: only reclaim file pages in node reclaim when over min_unmapped_pages mm/vmscan: drop the combined limit gate in __node_reclaim() mm/vmscan: do not skip node reclaim when only anon is reclaimable mm/vmscan.c | 89 ++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 67 insertions(+), 22 deletions(-) -- 2.34.1