From: "Hui Zhu" <hui.zhu@linux.dev>
To: Johannes Weiner <hannes@cmpxchg.org>,
Michal Hocko <mhocko@kernel.org>,
Roman Gushchin <roman.gushchin@linux.dev>,
Shakeel Butt <shakeel.butt@linux.dev>,
Muchun Song <muchun.song@linux.dev>,
Andrew Morton <akpm@linux-foundation.org>,
Chris Down <chris@chrisdown.name>,
cgroups@vger.kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Cc: Hui Zhu <zhuhui@kylinos.cn>
Subject: [PATCH 0/2] mm: memcg: fix memory.high allocator throttling
Date: Tue, 17 Nov 2026 16:04:19 +0800 [thread overview]
Message-ID: <cover.1794902513.git.zhuhui@kylinos.cn> (raw)
From: Hui Zhu <zhuhui@kylinos.cn>
calculate_high_delay() converts how far a cgroup is over memory.high or
memory.swap.high into a sleep penalty. Two defects corrupt that penalty,
and since the caller treats "penalty_jiffies <= HZ / 100" as "nothing to
do", a small result silently skips both the throttle and the
MAX_RECLAIM_RETRIES reclaim loop.
1/2: the u64 product is stored in an unsigned long before being shifted
right 34 bits, so on 32-bit kernels it truncates to zero and no overage
ever produces a penalty. Broken since v5.6.
2/2: the u64 product itself overflows once a cgroup is about 130x over its
limit, leaving an arbitrary result that can be zero. memory.high has no
lower bound, so a one page limit with a few MB of usage gets there. Also
affects 64-bit kernels.
Both touch calculate_high_delay(), so apply in order. Different Fixes
tags, both for stable.
Hui Zhu (2):
mm: memcg: fix zero throttle delay on 32-bit kernels
mm: memcg: fix memory.high throttle lost to u64 overflow
mm/memcontrol.c | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
--
2.53.0
next reply other threads:[~2026-11-17 8:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 8:04 Hui Zhu [this message]
2026-11-17 8:04 ` [PATCH 1/2] mm: memcg: fix zero throttle delay on 32-bit kernels Hui Zhu
2026-11-17 8:04 ` [PATCH 2/2] mm: memcg: fix memory.high throttle lost to u64 overflow Hui Zhu
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=cover.1794902513.git.zhuhui@kylinos.cn \
--to=hui.zhu@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=chris@chrisdown.name \
--cc=hannes@cmpxchg.org \
--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=shakeel.butt@linux.dev \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox