From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796457936; b=3SfHlGur/Kd+ZuMp+n0i6+HxBCnECZnOwMeEk4oVnmBN61ehQ072GKzEyRcYPeEDyOb6 O8GhJbZmYQqSWtOd0eYP5j0uhfpAohHEzy6V2HPIhCkd5K7a6q0v4nxIpub7u8SrF0ddi hLKU7GkyJBJKwCouTtpjHsZi9pSphBoql1ygpz/G8cbXIclbIFRl4RJ1vgD4eBAtcowMe LW1s43Q6sGhIdixy7IS/1mp112YOhVhQRYaanmhkeMuaKYm4iU4BOzU02zAIfkimYK+wv bkuqU2w5RmZ1l4wMrtTI14EeQAxY35+BIH/MIPuRULCd/uEx/R2gx8wXE2+zlQfXiBA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796457936; h=Received:DKIM-Signature:Date:To:From:In-Reply-To:References:Subject: Message-Id; bh=u9ye2z8zKPt6W/eVxpQD2ubb2C8Egrxq39bgqNHtcI0=; b=LbHfEHJOyRKV/+w0iVgcJ2bPHpbT55IT7WFDW2xlrWZPHuZskxzlY+3hLoTlO8E0vvdO OS4o9gaH13nanp1mz0fUZecrzExUB7KWihyiKZK/PWS70QZvhFqLegXgRyilyhnFd3Jtr va1Xai4RNfE79gYfMBR+ycunnXVdqPd7l+9wYQlPyOXyDQPj+/zSsY7Pl66LUkPw06hL4 EA3eFNyUCJMp7KaJaNPQDcju0VOKOW078Jj+gtP4HegclUyUASKXYp09dMly5WCgh3Ze2 fxS7gJFD9qjtQKnBsHju1rbRMsfNsxrfgVrkCjiAziHncGf04IeRB25APRvu+XxhOfQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=EcuZObqW; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DEA1E606A322 for ; Sat, 5 Dec 2026 08:05:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=EcuZObqW Received: by smtp.kernel.org (Postfix) with ESMTPSA id 767D51F0092B; Sat, 5 Dec 2026 08:05:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1796457936; bh=u9ye2z8zKPt6W/eVxpQD2ubb2C8Egrxq39bgqNHtcI0=; h=Date:To:From:In-Reply-To:References:Subject; b=EcuZObqW0y99FfJyfDmsmLQwKsek2pPY1bD5CqkXQ4/YywwKLPdreKPPOLDin0LDm Tl4DLILQgqkk9A8VFiOEZjSPrfa2RY3U2vNmRN0K6nAlab2yiiZXrmeQxxyL1xqeaU ArI7pBxQIVyUwFzYixqk+ii/HF3Nemd+1gTETsMQ= Date: Sat, 05 Dec 2026 00:05:36 -0800 To: mm-commits@vger.kernel.org,ziy@nvidia.com,yosry@kernel.org, xlpang@linux.alibaba.com,usama.arif@linux.dev,shakeel.butt@linux.dev, ryncsn@gmail.com,roman.gushchin@linux.dev,qi.zheng@linux.dev, nphamcs@gmail.com,muchun.song@linux.dev,mkoutny@suse.com,mhocko@kernel.org, hannes@cmpxchg.org,gourry@gourry.net,david@kernel.org,david@fromorbit.com, chengming.zhou@linux.dev,baolin.wang@linux.alibaba.com, qinyuntan@linux.alibaba.com,akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20261123105334.2524066-4-qinyuntan@linux.alibaba.com> References: <20261123105334.2524066-4-qinyuntan@linux.alibaba.com> Subject: + mm-thp-restore-shrinker_nonslab-on-the-deferred-split-shrinker.patch added to mm-new branch Message-Id: <20261205080536.767D51F0092B@smtp.kernel.org> X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list The patch titled Subject: mm: thp: restore SHRINKER_NONSLAB on the deferred split shrinker has been added to the -mm mm-new branch. Its filename is mm-thp-restore-shrinker_nonslab-on-the-deferred-split-shrinker.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-thp-restore-shrinker_nonslab-on-the-deferred-split-shrinker.patch This patch will later appear in the mm-new branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Note, mm-new is a provisional staging ground for work-in-progress patches, and acceptance into mm-new is a notification for others take notice and to finish up reviews. Please do not hesitate to respond to review feedback and post updated versions to replace or incrementally fixup patches in mm-new. The mm-new branch of mm.git is not included in linux-next If a few days of testing in mm-new is successful, the patch will me moved into mm.git's mm-unstable branch, which is included in linux-next Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via various branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there most days ------------------------------------------------------ From: Qinyun Tan Subject: mm: thp: restore SHRINKER_NONSLAB on the deferred split shrinker Date: Mon, 23 Nov 2026 18:53:33 +0800 On a system booted with cgroup.memory=nokmem, the deferred split shrinker is demoted to a non-memcg-aware one. As a result, partially unmapped THPs are only split under global reclaim; memcg (limit-induced) reclaim never splits them, so a cgroup under memory pressure keeps its underused THPs intact. The shrinker has carried SHRINKER_NONSLAB since commit 0a432dcbeb32 ("mm: shrinker: make shrinker not depend on memcg kmem") precisely so it would keep working with kmem accounting disabled. Commit fafaeceb89a5 ("mm: switch deferred split shrinker to list_lru") dropped it knowingly: under nokmem the list_lru collapses into a shared per-node list while __list_lru_add() still sets the shrinker bit on whichever memcg happens to add the first item, and with the flag set the shrinker would run twice per reclaim cycle. NONSLAB-backed lrus keep their per-memcg lists under nokmem now, so the shrinker bit identifies the owning memcg again. Restore the flag. This was noticed by Michal during review of the patch "mm/list_lru: don't copy stale shrinker id from non-memcg-aware shrinkers". Link: https://patch.msgid.link/20261123105334.2524066-4-qinyuntan@linux.alibaba.com Link: https://lore.kernel.org/all/ah9PGv12mqai84ES@cmpxchg.org/ Link: https://lore.kernel.org/lkml/697713c4-0857-485b-aba7-c74f37a3c8b4@linux.alibaba.com/ Fixes: fafaeceb89a5 ("mm: switch deferred split shrinker to list_lru") Signed-off-by: Qinyun Tan Signed-off-by: Andrew Morton Suggested-by: Michal Koutný Acked-by: Zi Yan Acked-by: David Hildenbrand (Arm) Acked-by: Usama Arif Reviewed-by: Baolin Wang Reviewed-by: Johannes Weiner Acked-by: Muchun Song (ByteDance) Cc: Michal Hocko Cc: Roman Gushchin Cc: Shakeel Butt Cc: Dave Chinner Cc: Qi Zheng Cc: Yosry Ahmed Cc: Nhat Pham Cc: Chengming Zhou Cc: Xunlei Pang Cc: Kairui Song Cc: Gregory Price mm/huge_memory.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/mm/huge_memory.c~mm-thp-restore-shrinker_nonslab-on-the-deferred-split-shrinker +++ a/mm/huge_memory.c @@ -1058,7 +1058,8 @@ int folio_memcg_alloc_deferred(struct fo static int __init thp_shrinker_init(void) { deferred_split_shrinker = shrinker_alloc(SHRINKER_NUMA_AWARE | - SHRINKER_MEMCG_AWARE, + SHRINKER_MEMCG_AWARE | + SHRINKER_NONSLAB, "thp-deferred_split"); if (!deferred_split_shrinker) return -ENOMEM; _ Patches currently in -mm which might be from qinyuntan@linux.alibaba.com are mm-list_lru-index-per-memcg-lists-by-memory-css-id.patch mm-list_lru-keep-per-memcg-lists-with-nokmem-for-nonslab-backed-lrus.patch mm-thp-restore-shrinker_nonslab-on-the-deferred-split-shrinker.patch mm-zswap-mark-the-zswap-shrinker-shrinker_nonslab.patch