From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 7C8C5330D50 for ; Thu, 26 Mar 2026 08:19:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774513197; cv=none; b=PFFsqsbK2IrY2NnVP44H6PnPosYesvqZkxYTFzMMh+0zDhd/goLY3CrARokcgGHvYcHkAHHnyHdNB1krfn5R1GMyRzAa1d5dpQBLg201VSrsF+i31fIzIUNOwkmPYeWiPXVBTsfEVbsojEO7arKuIZ8OnLllgmbqbClwAs+mMG0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774513197; c=relaxed/simple; bh=kmZd/Y3BrScNBiGSWx6bpuwl/waYMYQG7ahxj4ypNiA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FfPt23NtZ6NtlYBbiaZiCrTg+Nx4sPvQBLX/jK5dkCYMb3/G8V4izJbXoI1u31g8jCbhVeNVp7pbanEWMrUnymNAVgHdD0DxNQng057EnHAWg5vrc2lh4IzmuMu4dMCknPbqqmcHAdMNAAkY3FMfCLglHGdXFJ8H6SxkMnSlC48= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Zu2v/VtL; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Zu2v/VtL" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AE5C6C116C6; Thu, 26 Mar 2026 08:19:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774513197; bh=kmZd/Y3BrScNBiGSWx6bpuwl/waYMYQG7ahxj4ypNiA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Zu2v/VtLWyhE1/BeOXveBKbAh5pxhRiuniOG/45V9P/Fj9WKWZYsYyBQKd2BXhp2Q ge4weDjJjHIx6J/Cw9sghCFfJ5IIs3FCdtN1d0WXmbtfwmHxpmAHuloAtbmL/Q7c1/ J4FB34ZLZ4MnUsIAY5jxHep0RmqMl0Td4xc8bfJvVolFh7NYHEi3kLcb9AB9leZRW9 jj2ug1obEra+AD9HcYU+t2/KFisOkMaPjkRDQ175DA+DKj4mGZcis0+r9p2KkNGhdJ 6pzLswbqn29eZDbrYGh5MT+9qK6M7BW69YhQKiCxn2AcyGiXxA1/POMW1Q0/4AEJ6/ XEdn0LGT31JUg== Date: Thu, 26 Mar 2026 17:19:54 +0900 From: "Harry Yoo (Oracle)" To: "Lorenzo Stoakes (Oracle)" Cc: Qi Zheng , hannes@cmpxchg.org, hughd@google.com, mhocko@suse.com, roman.gushchin@linux.dev, shakeel.butt@linux.dev, muchun.song@linux.dev, david@kernel.org, ziy@nvidia.com, yosry.ahmed@linux.dev, imran.f.khan@oracle.com, kamalesh.babulal@oracle.com, axelrasmussen@google.com, yuanchu@google.com, weixugc@google.com, chenridong@huaweicloud.com, mkoutny@suse.com, akpm@linux-foundation.org, hamzamahfooz@linux.microsoft.com, apais@linux.microsoft.com, lance.yang@linux.dev, bhe@redhat.com, usamaarif642@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Qi Zheng Subject: Re: [PATCH v2 1/4] mm: memcontrol: correct the type of stats_updates to unsigned long Message-ID: References: <158fa0b1296168047342f02050e9d2bda6888d27.1774447069.git.zhengqi.arch@bytedance.com> <3eb8b252-b6fa-4708-8c84-bf90142fe682@lucifer.local> 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3eb8b252-b6fa-4708-8c84-bf90142fe682@lucifer.local> On Thu, Mar 26, 2026 at 08:05:57AM +0000, Lorenzo Stoakes (Oracle) wrote: > On Thu, Mar 26, 2026 at 10:32:43AM +0800, Qi Zheng wrote: > > > > > > On 3/25/26 11:28 PM, Lorenzo Stoakes (Oracle) wrote: > > > On Wed, Mar 25, 2026 at 10:13:22PM +0800, Qi Zheng wrote: > > > > From: Qi Zheng > > > > > > > > The memcg_rstat_updated() tracks updates for vmstats_percpu->state > > > > and lruvec_stats_percpu->state. Since these state values are of type long, > > > > change the val parameter passed to memcg_rstat_updated() to long as well. > > > > > > > > Correspondingly, change the type of stats_updates in struct > > > > memcg_vmstats_percpu and struct memcg_vmstats from unsigned int and > > > > atomic_t to unsigned long and atomic_long_t respectively to prevent > > > > potential overflow when handling large state updates during the > > > > reparenting of LRU folios. > > > > > > Do we need a Fixes, possibly cc: stable for that? Apologies if already > > > asked + answered. > > > > Before LRU folio reparenting was introduced, we wouldn’t pass in such a > > large value, so this wasn’t a problem. Since LRU folio reparenting is > > still in mm-unstable, so I didn't add a Fixes tag in [4/4]. > > Ah, well these patches should be _before_ the LRU folio reparenting then? Yes. I think that'll be the best option. If that's too much of a headache at this point (I'm not sure), it should be at least part of 7.1-rcX, given that it's quite unlikely that people will notice it during bisection anyway... -- Cheers, Harry / Hyeonggon