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 98DFE2BE7B6 for ; Tue, 24 Mar 2026 14:24:59 +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=1774362299; cv=none; b=ZvpilPQyQmmJR3Jd1WQsC2zD8+g8ZgwUjbA1I2bCy54UGSohdpSEtyc9RjsW/wTtXVyXS/1agama1wCSE3QM2pQzol8aHzl5PU6F8KGsquP+BNfyHGNsPUhOiPKzddDQpNhBuai6/pMynbDxFi7NIj1KULyyyp5pGaojJmujFi4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774362299; c=relaxed/simple; bh=P9LxY7AGOQOGKye5faI/iTdL7c46AeioKoHZcFvNQmo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=NV5vTVFCVyrQE0f5TmS5V2sDhW/NhDv/2Pv75zknDJqM5s3o7zWKz0Jg/gdr0Urd2BSorw4cAv4IGJAiGUYDqm7FaA7kq5DOSiWSWq9nwG7oMDmMSOvKfduj+oVs/Qn8Syjsr9nElYqKWOBzWNQxSRwJbtFwXWpfxFHCSD4hvK4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TMC+1hX6; 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="TMC+1hX6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC9D8C19424; Tue, 24 Mar 2026 14:24:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774362299; bh=P9LxY7AGOQOGKye5faI/iTdL7c46AeioKoHZcFvNQmo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TMC+1hX65oFntko1iQvIVY/7MNekNKqgZRhcpeG74hj5ObkBTFUlcfeFuzI6d7xP5 t4ICCETg14pvCbrDjL4gb0FAVwmmtyRUXty6lUGpStvzshK1Pd3kaWiUcNVchWn4XS cHOJVZj6VjktDAcJYpDUbt5Lx9nk7orlJEEFXOxBX7G6kThxwvo+YiJHtKU5xnCrVp CqwSkKlSvleNkKjxzrPPqloKZ53KdTMplEiEveHxtP2+dk1114pEYZovHsc/u5AgA+ fGDgETlS80AdVCy+htfKyhFXVl9C/6Wf8wj7MD/k5KLhiRA7GMQ30R1Oi79uJqIHkh nLNWmDOHq0V8g== Date: Tue, 24 Mar 2026 14:24:50 +0000 From: "Lorenzo Stoakes (Oracle)" To: Matthew Wilcox 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, lorenzo.stoakes@oracle.com, 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 2/3] mm: memcontrol: correct the parameter type of __mod_memcg{_lruvec}_state() Message-ID: <2d03e270-4dd1-4a37-b6ce-e97b1760a6e2@lucifer.local> References: <90524ca3806e24105ab5f2d69435f57c2ae034cb.1774342371.git.zhengqi.arch@bytedance.com> <98dfab09-f3c5-4503-94e4-c3f097539afd@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=us-ascii Content-Disposition: inline In-Reply-To: On Tue, Mar 24, 2026 at 02:12:00PM +0000, Matthew Wilcox wrote: > On Tue, Mar 24, 2026 at 12:21:06PM +0000, Lorenzo Stoakes (Oracle) wrote: > > On Tue, Mar 24, 2026 at 07:31:28PM +0800, Qi Zheng wrote: > > > From: Qi Zheng > > > > > > The __mod_memcg_state() and __mod_memcg_lruvec_state() were used to > > > reparent non-hierarchical stats, the values passed to them might exceed > > > the upper limit of the type int, so correct the val parameter type of them > > > > Why might they? What precipitated this change? > > > > > to long. > > > > Why is it a signed value? > > Because 'mod' can both increase and decrease this counter. It must be > signed. Right yeah noticed that in another patch :) Cheers, Lorenzo