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 59AE63537CD for ; Thu, 26 Mar 2026 08:06:05 +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=1774512365; cv=none; b=A2IrL9c69n3s4/gVZaf8f0Do44BdEGZvYM+fInvF/vepmDUWhQceBPcicc9WKy3ZPaxAXzpaTUzIsjQoWcgy7ywfY9AJW8dPW0sqHxD5kIMgRMgRi0iOo2yUGyfE7dOefUsHfEQY02SKg2x6eVtc/JPykg4fyYHyyU0K9rSYA/w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774512365; c=relaxed/simple; bh=qocLzhKoNwuEpBKBumgzNhJetl4M5jN1U/FB4uOTE5E=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Omw0/pEiJc/IoeNs4yPscFk+f54nVNVkmm1v05+lc6SksXmqOpamx/O12yLx5Dhj8z4erTXit25wCYCT+sbpd7QAojdwTvZtszQL3XU65/16RAYdbd8BpIH/u32scigb5wg6VzGn7bb0quv5Z3nes5eHuLsVD/YNXjnPLMm8jkE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Us+jO5Lm; 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="Us+jO5Lm" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 67DC6C116C6; Thu, 26 Mar 2026 08:05:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774512365; bh=qocLzhKoNwuEpBKBumgzNhJetl4M5jN1U/FB4uOTE5E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Us+jO5LmAS8vTN0skQ/Gyvi5wp7dJizYUkwWyiMv0jbc9m1/rr92yozXMieqJZ+Ob MeaZZagHCuVdgI7IiLvw04CUH5gfJc00cMV6BNFSDS5jghA0YBaVl4bL7IdpquuvD5 b9o/jex3ZFRk0KPW4jhjlUqegB5rKA2v6zG+vJSMrf58ROoxTNPR5Mkcuu65EJHoZB imYc5bUK4AO+kuwhUmjYbyBfh5YtEHEjlXHoteU/pTaUquHGpe04ox3rnD8XHucKBu eO7z/gz03O4i01TjrYroOlMBZyU/ggZvu7hpgX5fcluNMV0uyafoNwrmCYQThTIsre GoArltuDDBTrw== Date: Thu, 26 Mar 2026 08:05:57 +0000 From: "Lorenzo Stoakes (Oracle)" To: Qi Zheng Cc: 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, harry.yoo@oracle.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: <3eb8b252-b6fa-4708-8c84-bf90142fe682@lucifer.local> References: <158fa0b1296168047342f02050e9d2bda6888d27.1774447069.git.zhengqi.arch@bytedance.com> 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: 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? Andrew - can we ensure correct ordering here? > > > > > > > > > Signed-off-by: Qi Zheng > > > > Anyway logic seems fine to me, so: > > > > Reviewed-by: Lorenzo Stoakes (Oracle) > > Thanks! > > Thanks, Lorenzo