From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.14 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796401823; b=KZxTzSystBbaRRKcQrwOi9bOtIw4db/f6aG1HSceOQ9RD3uoAqnFen0McpfogpzPzb6w TGcTSOM7KRfBHEkWKPwwkPQE9LEhtxL1VrAHR/G7VUdLP0BxtB7BlfN0DXrCTjZQxxtzo RrbvFaNZ3Cjv35Vj6+8YhosApm86L4sgqRF02bUNI3iSULUUc4gfi8eoWstaZ6LCjxu0u 5mIM85ZHfzqWPk5EMmc2kUtSMolKOpgd5Kq7p8Ky0uKwPeHQC8q4ligO5lTC1rX9jihpY t3V+Oa+IzJqiqpKLndAH4BEfPB8bgdPydu40mW2cJMJde0GoBTJ6BMwBbYpktwpx70A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796401823; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=zhf6IJ8YvwA5Lmt8n0+gyKOBYgGKVSNYAOEVBDy6Two=; b=eyBeS6y8dZ0nK1MFN3rMbMJOJNyVNUCarsiEGb34P7fLg60qo+fK/PfqcPPvXzHWfWcB RdI995xpZ+f3xFIGb7f3oQA3sG6FranLFpE4TuHevivHIvAQbtOJNL0BZ7qoATam1D5s+ nN8EeYLU/rRZfAG4orqT4YIc4kebgn6e6EBhbqwiDPeiabkv1VYZJcOCAIgIJp528Zrz8 lrngFC2fx5hycia2wuHnV9y4wJyUF1rhgsLneLTcHVotntuyffHaE8jgTsj5JIK8/arcF prwCMUyCLtu+mzKLNf39bssuG4WrSkj6+5f7L99xINpFS/2sks3IdFnJSMhRNGKcyKQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=C+qZFAfJ; arc=none smtp.remote-ip=95.215.58.14 Received: from mta1.migadu.com (out-14.mta1.migadu.com [95.215.58.14]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1CBF1606A332 for ; Fri, 4 Dec 2026 16:30:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 1CBF1606A332 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, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=C+qZFAfJ X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=pRvSABgn8oLlnVDYGiN73koRS9SqQHTUl0LxR34RYy4=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1796401819; v=1; x=1797006619; b=C+qZFAfJBftYR/x20aDfMdUAc9J/MFGxoM6+thnAfe53uJA8EsYLisxKFmKsSHBKP4ACgTIM 82QkDXtjDj/Q5W1NBe+23o3ybhNQ2ViJVofqK9PQhcQ1zlxpxAfo5jIs9JMb2U/pg4ehWXKaZCW P/rJsTi//FCwuQuur9I1gD+E= X-Envelope-To: linux-kernel@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id f35559fefecd7369; Fri, 04 Dec 2026 16:30:17 +0000 X-Mizu-Trace-ID: f35559fefecd7369 X-Migadu-Flow: FLOW_OUT Date: Fri, 4 Dec 2026 08:30:15 -0800 From: Shakeel Butt To: Hui Zhu Cc: Johannes Weiner , Michal Hocko , Roman Gushchin , Muchun Song , Andrew Morton , Chris Down , zhangjiao2@cmss.chinamobile.com, Alireza Asgari , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Hui Zhu , stable@vger.kernel.org Subject: Re: [PATCH v2 1/2] mm: memcg: fix zero throttle delay on 32-bit kernels Message-ID: References: <1ef1fa130f9bd4a94bf92335486729f05034c30d.1796367145.git.zhuhui@kylinos.cn> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1ef1fa130f9bd4a94bf92335486729f05034c30d.1796367145.git.zhuhui@kylinos.cn> On Fri, Dec 04, 2026 at 03:18:19PM +0800, Hui Zhu wrote: > From: Hui Zhu > > calculate_high_delay() stores max_overage * max_overage * HZ, computed as > u64, into an unsigned long before shifting it right by 34 bits in total. > On 32-bit kernels the store truncates the value to its low 32 bits, so the > shift always yields zero: memory.high and memory.swap.high throttling is > completely inert there. And since the caller reads "penalty_jiffies <= > HZ / 100" as "nothing to do", the MAX_RECLAIM_RETRIES reclaim loop is > skipped as well. > > Keep the intermediate in u64 so the shifts see the full width. Also make > the function return u64, and the caller's penalty_jiffies u64, so the > value is narrowed only after the caller has clamped it to > MEMCG_MAX_HIGH_DELAY_JIFFIES. Nothing changes on 64-bit kernels, where > unsigned long is already 64 bits wide. > > Fixes: e26733e0d0ec ("mm, memcg: throttle allocators based on ancestral memory.high") > Cc: stable@vger.kernel.org > Signed-off-by: Hui Zhu Acked-by: Shakeel Butt