From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-177.mta0.migadu.com (out-177.mta0.migadu.com [91.218.175.177]) (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 230F72931E3 for ; Thu, 23 Jul 2026 02:59:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784775565; cv=none; b=eNydkGa7XDX6q6pC+gZaxH/FlX0yOyZTk/8qnr6saOiIXus+TauLjVbFzmV2dlw07JZGU2WvHuGyXnsGN+VTmTGeCQ9Se31klKl6W5ozQx6qrB3aWe9ohS3zRni8taiva48F0C5RW3RXic8RROsvHPLr3Z2oqmdhBTZQudaGvCo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784775565; c=relaxed/simple; bh=ZIglIw1XuGPV0FB+8lncHWoPzzxwkqMpBGwV16CW4WA=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=k6eXFGKTQPGJYglBa5QPMYHMWloQfMxBBSi7jESvsKJyLVvL7jz/iLOGXtwLp/lUNszaWbUpfOg+n8gZ/fUFyA6lzuIjm/5SPavTVLTrOA5oXvXaWLvmUDrEp6UXYgJVWXHYjpcJXtKvI6EYBfjbcXoy0PIvwXp6P4YUtaCZZUk= 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=IvT+tuwv; arc=none smtp.client-ip=91.218.175.177 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="IvT+tuwv" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1784775560; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=lxnP6SUwergpNTfnZVhMNth7W47feWOp/n3K9KDqgX0=; b=IvT+tuwvJNHdUbyD7+s3z1Z3+78G2kQUozmyyg3XdVZuRdm5rEjCKXQvTBYChs6T2lhGPV vV15mlwODOefNbdR27GrCSMo9gfaX32qzMfzomG8HuHRbLgVyg1W5aFY2vsIz8ab+WOkzM KZX4PToNn2LIZnvBxSNMoT+WGBQspKk= From: Ridong To: Johannes Weiner , Michal Hocko , Roman Gushchin , Shakeel Butt , Andrew Morton , Chris Li , Kairui Song Cc: Muchun Song , Kemeng Shi , Nhat Pham , Baoquan He , Barry Song , Youngjun Park , David Hildenbrand , Qi Zheng , Lorenzo Stoakes , Axel Rasmussen , Yuanchu Xie , Wei Xu , Davidlohr Bueso , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Song Hu , Ridong Chen , Ridong Chen Subject: [PATCH -v3 0/2] mm: vmscan: fix node reclaim ignoring swappiness parameter Date: Thu, 23 Jul 2026 10:58:56 +0800 Message-Id: <20260723025858.1956584-1-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-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT From: Ridong Chen The per-node proactive reclaim interface (/sys/devices/system/node/nodeX/reclaim) accepts a swappiness parameter, but it is silently ignored when CONFIG_MEMCG is disabled. The root cause is that sc_swappiness() has separate implementations for CONFIG_MEMCG and !CONFIG_MEMCG, and the latter never checks proactive_swappiness. Patch 1 moves mem_cgroup_swappiness() and vm_swappiness out of the public include/linux/swap.h into the mm-private mm/swap.h, and makes the helper handle both CONFIG_MEMCG and !CONFIG_MEMCG in a single inline function. This is a prerequisite for unifying sc_swappiness(). Patch 2 consolidates sc_swappiness() into a single definition that works regardless of CONFIG_MEMCG, fixing the node reclaim swappiness bug. --- v2 -> v3: - Simplify mem_cgroup_swappiness as suggested by Johannes. - Rebase on the next-20260722 v1 -> v2: - Move mem_cgroup_swappiness() and vm_swappiness to mm/swap.h instead of include/linux/memcontrol.h. Suggested by Barry Song. - Correct fix tag for patch 2. v1: https://lore.kernel.org/all/20260711091157.306070-1-ridong.chen@linux.dev/ Ridong Chen (2): memcg: move mem_cgroup_swappiness and vm_swappiness to mm/swap.h mm: vmscan: fix node reclaim ignoring swappiness parameter include/linux/memcontrol.h | 4 ++-- include/linux/swap.h | 19 ------------------- mm/memcontrol.c | 4 ++-- mm/swap.h | 13 +++++++++++++ mm/vmscan.c | 19 +++++++------------ 5 files changed, 24 insertions(+), 35 deletions(-) -- 2.34.1