From: Shakeel Butt <shakeel.butt@linux.dev>
To: Hui Zhu <hui.zhu@linux.dev>
Cc: Johannes Weiner <hannes@cmpxchg.org>,
Michal Hocko <mhocko@kernel.org>,
Roman Gushchin <roman.gushchin@linux.dev>,
Muchun Song <muchun.song@linux.dev>,
Andrew Morton <akpm@linux-foundation.org>,
Chris Down <chris@chrisdown.name>,
zhangjiao2@cmss.chinamobile.com,
Alireza Asgari <alireza@asgari.net>,
cgroups@vger.kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, Hui Zhu <zhuhui@kylinos.cn>,
stable@vger.kernel.org
Subject: Re: [PATCH v2 1/2] mm: memcg: fix zero throttle delay on 32-bit kernels
Date: Fri, 4 Dec 2026 08:30:15 -0800 [thread overview]
Message-ID: <axLqgRGhO3IbwJRA@linux.dev> (raw)
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 <zhuhui@kylinos.cn>
>
> 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 <zhuhui@kylinos.cn>
Acked-by: Shakeel Butt <shakeel.butt@linux.dev>
next prev parent reply other threads:[~2026-12-04 16:30 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-04 7:18 [PATCH v2 0/2] mm: memcg: fix memory.high allocator throttling Hui Zhu
2026-12-04 7:18 ` [PATCH v2 1/2] mm: memcg: fix zero throttle delay on 32-bit kernels Hui Zhu
2026-12-04 14:02 ` Johannes Weiner
2026-12-04 16:30 ` Shakeel Butt [this message]
2026-12-05 7:32 ` + mm-memcg-fix-zero-throttle-delay-on-32-bit-kernels.patch added to mm-new branch Andrew Morton
2026-12-04 7:18 ` [PATCH v2 2/2] mm: memcg: fix memory.high throttle lost to u64 overflow Hui Zhu
2026-12-04 14:03 ` Johannes Weiner
2026-12-04 16:36 ` Shakeel Butt
2026-12-05 4:28 ` Tao Cui
2026-12-05 5:58 ` Muchun Song
2026-12-05 7:32 ` + mm-memcg-fix-memoryhigh-throttle-lost-to-u64-overflow.patch added to mm-new branch Andrew Morton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=axLqgRGhO3IbwJRA@linux.dev \
--to=shakeel.butt@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=alireza@asgari.net \
--cc=cgroups@vger.kernel.org \
--cc=chris@chrisdown.name \
--cc=hannes@cmpxchg.org \
--cc=hui.zhu@linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=muchun.song@linux.dev \
--cc=roman.gushchin@linux.dev \
--cc=stable@vger.kernel.org \
--cc=zhangjiao2@cmss.chinamobile.com \
--cc=zhuhui@kylinos.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.