From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out30-132.freemail.mail.aliyun.com (out30-132.freemail.mail.aliyun.com [115.124.30.132]) (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 F0CCD3876C6 for ; Thu, 6 Aug 2026 05:35:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.132 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785994535; cv=none; b=MH+m0knL/QF/tTg61A7F5pz9O7yy6aMHYkkEnP3glnvFnp+sZbIh53hoEdh4T/k1vIywZ3TlNC5gLCko7N+sMx70DP71+Qvj0y2G3AUhpEo1vzwIe7gB66QROVrNuXkPhFdlObS/L3VHq7z1YiMZmV24zthrRqkZZAkux4ogxYI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785994535; c=relaxed/simple; bh=krqO7cIls+4/B9Rgsuyghy4Em8LaW0jchhy05+RNj8c=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=AlIkd7KjX6HuIZVzc0KsQKRKhT9G39MjK0f5lQ9uyU+Ua0jYQftqHchTlHkFGEd1rb9me4VykH6zs+SI8mO8QDhueHFRrDaL43p461iypGNL7ItOIIXvEcg6Lb6o0Cy4k+ZOoRVklZAL+3jh2CBSPlwdvs10ES9gSftSBL/ha80= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=DiqMnpnk; arc=none smtp.client-ip=115.124.30.132 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="DiqMnpnk" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1785994529; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=D9phiXDHjrSLovQ25oeaKf4LKyu1U2UfKUgGrIYgwmU=; b=DiqMnpnk/LJlP09G8MYc33oIx1cvrB7kZ11p1lY3DgPr6AN7ahDRQGNIrd6vaIxyQ5uwVQofo8PD5Ugglk5ZPacjNLVLkk1ZdSoJZrT3nbv+qZG5PSVOemAJjfg+6azKt/LQskH+vM1xR1Abq5GtM/KAV5kGU2VsgaGHko8zFFM= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R121e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033032089153;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=9;SR=0;TI=SMTPD_---0X8T-XQa_1785994527; Received: from 30.74.144.136(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0X8T-XQa_1785994527 cluster:ay36) by smtp.aliyun-inc.com; Thu, 06 Aug 2026 13:35:28 +0800 Message-ID: Date: Thu, 6 Aug 2026 13:35:26 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 3/3] mm: shmem: make unused huge shrinker memcg aware To: Qi Zheng , hughd@google.com, usama.arif@linux.dev, brauner@kernel.org, akpm@linux-foundation.org, david@kernel.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Qi Zheng References: From: Baolin Wang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 8/3/26 4:46 PM, Qi Zheng wrote: > From: Qi Zheng > > The shmem unused huge shrinker keeps a per-superblock list of inodes whose > tail huge folio extends beyond i_size. Since that list is not memcg aware, > reclaim triggered by one memcg can scan inodes from the whole superblock > and split shmem huge folios charged to unrelated memcgs. > > Convert the shrink list to a memcg-aware list_lru. Queue each inode on the > list_lru sublist matching the memcg and node of the current tail huge > folio, so non-root memcg reclaim only walks candidates charged to the > reclaiming memcg. Global reclaim, root memcg reclaim and shmem quota > reclaim keep global semantics. > > The list_lru still tracks inodes while the actual split target is the > current tail huge folio, so validate the folio memcg/node during scan. If > the folio no longer matches the reclaim context or splitting cannot > proceed, requeue the inode according to the current tail folio; if the > inode is no longer shrinkable, drop the scan entry. > > This can be tested with the shrinker debugfs interface by allocating 32 > tmpfs tail THPs in each of two memcgs, then scanning the sb-tmpfs shrinker > with memcg A's cgroup id: > > before A scan after A scan > base A=64M, B=64M A=64M, B=64M (per-memcg count is skipped) > patched A=64M, B=64M A=0, B=64M > > Signed-off-by: Qi Zheng > --- Apart from the two issues Sashiko pointed out (which you've already replied to), nothing else jumped out at me. Thanks.