From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.117 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796401823; b=jIWxj69cNUifP5nMBvvK8Hvsxwkzfyb8PT3b2BhhqGOt18VqWEE20oweW6fOs+UrGIY7 ClpQuV7U5qCTO027e0+GihL7T3Ai9HezWOpFSnGw1NPpTinO0CeeXNdv3pDYlYiIZWqab uws7aHnkMXq1d4tRDxTpGsekq852/LfDT8W49QVumfrFya7+29dY4DMHodn7hBEVP3JNv 5qbxhMIoNF5vSHr2AyEcQEKgLV0hgZBZfQnDMx0ZD1x6wsOr7cugPKlPGcC0SZDQRU4bD Ty+RDfja2ge6us0stgGyDbMX5TKit6qB5RmjNAqejQlLzWZp4IzhbFdrwLT13Yz3Bag== 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=yfLXsN3dafz1bJKoqOfWjFbtIol5nZcB0rmsDioOa9A8R/XnNCBIzrBJgHMtSdowGjbG cy8aPaP4nLSCKw9GmFhuGjz1ajPoCn58e13UyHGXu9uxuScM0Il0iehRZweg/HTmDi5bm oJSjTV19GPY04NicQr4Hrnu5MRCOLcrkGH9Uz007rWBldRf3sb77CYuXDJN/AG6A9L0YG +vjJv6gcT+RosS0ktAvFMiI6wf0Co8QNes0E9cEbMylbpz+/jdySKda4H5kuEH3sjd2Pt bemz4OLehmEx3jRu4cR371UTGoiO4FY0PZ7FYW1ZU81BXg4aDicmhD287ugXhRhqCkg== 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=xPiyNKOs; arc=none smtp.remote-ip=91.218.175.117 Received: from mta0.migadu.com (out-117.mta0.migadu.com [91.218.175.117]) (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 D2DBF606A335 for ; Fri, 4 Dec 2026 16:30:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D2DBF606A335 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=xPiyNKOs X-Envelope-To: stable@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=1796401820; v=1; x=1797006620; b=xPiyNKOsmrEe15Tn7uV7zgSK505SdB13CWREkZxCU0HRfBYFEBQvUnOBYIHf38689gv+zRyS by4pBSrt8KMp2a1Hh255GHXUosklNkLvacd27yeNhbqbXhPqZcF1x4d7BZRca1KXk+gE2rF1lrj rET+aFidoZNyVkM3B00TVZlQ= X-Envelope-To: stable@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: stable@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