From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-173.mta0.migadu.com (out-173.mta0.migadu.com [91.218.175.173]) (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 6F11E2E2EEE for ; Thu, 16 Jul 2026 03:18:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784171886; cv=none; b=sYnFRPKTibRS5pfZQs+b6hcgUMunzn7CSwDaWNX6OqBeKrDNwZ3cv2Q/TjT7d5ORRCVoeHeVIHHLFvgqDmSnWDqvfkyx2m5zuL4qyJtHoa99X61vQi2kwH3SF4SImKpYVdjKE0fbnCcPNoDcFMo6rOWk50uyDIRdCoXzFvxjyU4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784171886; c=relaxed/simple; bh=jNsYLCXIhhJHFfM7B5l2mf7E/wIuuVKRv6Mj06V5zdY=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=t7RbbCMj00scw65FPSl2bqt+8zyYXNBDQna4dX+5G6qB7mQnXRvX6JgdDRLpLUOirMS9Bpz9ryKJUW6i++FRTaO1/ehlowVZa2dc6V6pLUPpULd0GmWKvGqmM1RUFfbllDPmyIAwxxpjhaaOU5VjGb3f7ennZtdS+1SM87M+QS4= 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=Jvzy5ecU; arc=none smtp.client-ip=91.218.175.173 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="Jvzy5ecU" 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=1784171882; 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=C9uTjr+QHcjA0BGg5K3KptTToPaHw9+EB+dy4ID1gXs=; b=Jvzy5ecUdLoLt3ejPYRfKtMmP00eTeTy6jyspFaBAGcX6bY0p3xhysVQOfDqq/xGCPnKnM 8iDmZ7M7OeOU0kiLlSRpH5qz12RLOadT/H+YugzcE+9MsaeClWWHNlz+Tg+aGHHmz+kWJ3 wyr3bFNnVIIOBYpUGQBmxcm4q4KnScw= 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, Ridong Chen , Ridong Subject: [PATCH v2 0/2] mm: fix node reclaim swappiness handling Date: Thu, 16 Jul 2026 11:17:27 +0800 Message-Id: <20260716031729.1064007-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 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. --- 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 | 20 ++++++++++++++++++++ mm/vmscan.c | 19 +++++++------------ 5 files changed, 31 insertions(+), 35 deletions(-) -- 2.34.1