From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mta0.migadu.com (out-143.mta0.migadu.com [91.218.175.143]) (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 8C79B4A385A for ; Thu, 3 Sep 2026 17:55:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.143 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788458141; cv=none; b=Iz3ugU8uuTFr7YvGktA7N/JFaBXWcqRZDr5UZq7dCGIUfSYpe7vHhZqOnNTPmL89xIKREAv7OH+p3Oppklt5oQe9f7PCTohgEuD3z2TzLErX6cPbHMPlTn6fg3p9VHh0umDNq3jz7DqL4kGSwJUIXXp6NgedQvpA+arBT4gqYvI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788458141; c=relaxed/simple; bh=3cWqPp22IraIGu0JvB3xQlMqoKb4a/YFuTmuVC27eeM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=khPf+qlpNZIO+GA2VxITfeJDO7b3plvTiyDjyo/n5Mpz3sQxFkdBMefh3w+ZuG7mB898eiLX7gp7MSVmqCnoRBSD0sJq9Le8+palpwU0FcFxH0l3uSGY79C1dxF+LSX4ycfcGfXiuhjcfhXgXTD2x21hCb6GP0jUnbH3xvBEjBM= 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=BBlpvUw2; arc=none smtp.client-ip=91.218.175.143 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="BBlpvUw2" X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=3cWqPp22IraIGu0JvB3xQlMqoKb4a/YFuTmuVC27eeM=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1788458136; v=1; x=1789062936; b=BBlpvUw2RgIZusVVoCMvSFjY8j+K2JhYbj2ZiLegxvSijKM+7Yrxs7T65SJop68DOXNd7sF1 xabXaJ/UkbONF6THFkJXWzm1d8OlTVBXTVaaksqChOvPoPU0CEifrGd/U/8/Landsnq+1p9Lb70 3rfXu1uEvFld/ci6ifFeHRns= X-Envelope-To: linux-kernel@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id 82f448d9f30fec5e; Thu, 03 Sep 2026 17:55:33 +0000 X-Mizu-Trace-ID: 82f448d9f30fec5e X-Migadu-Flow: FLOW_OUT Date: Thu, 3 Sep 2026 10:55:31 -0700 From: Shakeel Butt To: Hui Zhu Cc: Johannes Weiner , Michal Hocko , Roman Gushchin , Muchun Song , Andrew Morton , David Hildenbrand , Qi Zheng , Lorenzo Stoakes , Kairui Song , Barry Song , Axel Rasmussen , Yuanchu Xie , Wei Xu , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Hui Zhu , stable@vger.kernel.org Subject: Re: [PATCH v2 1/3] mm: workingset: use lruvec_page_state_local() to count lru pages Message-ID: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Mon, Aug 31, 2026 at 05:46:09PM +0800, Hui Zhu wrote: > From: Hui Zhu > > Commit 7404bd37cfbe ("mm: workingset: use lruvec_lru_size() to get the > number of lru pages") switched count_shadow_nodes() to lruvec_lru_size(). > With CONFIG_MEMCG enabled, lruvec_lru_size() reads mz->lru_zone_size, > which only the classic LRU paths maintain. MGLRU accounts its pages > through __update_lru_size(), which skips that array, so with MGLRU on the > four evictable LRU lists are always seen as empty. The shadow node budget > (pages >> 3) then collapses to slab plus unevictable pages, and the > workingset shadow shrinker reclaims eviction tokens almost as fast as they > are created, losing thrashing protection. > > lruvec_page_state_local() reads lruvec_stats->state_local instead, which > both classic LRU and MGLRU maintain. Switch back to it. The reparenting > race this re-exposes on cgroup v2 is closed by the follow-up patch that > redirects dying-memcg stat updates for all hierarchies. > > Fixes: 7404bd37cfbe ("mm: workingset: use lruvec_lru_size() to get the number of lru pages") > Cc: stable@vger.kernel.org > Signed-off-by: Hui Zhu Reorder this after 2nd and with that Acked-by: Shakeel Butt