From: Joshua Hahn <joshua.hahnjy@gmail.com>
To: Song Hu <husong@kylinos.cn>
Cc: joshua.hahnjy@gmail.com, akpm@linux-foundation.org,
apopple@nvidia.com, axelrasmussen@google.com, baohua@kernel.org,
bsegall@google.com, byungchul@sk.com, cgroups@vger.kernel.org,
david@kernel.org, dietmar.eggemann@arm.com, gourry@gourry.net,
hannes@cmpxchg.org, harry@kernel.org, jackmanb@google.com,
juri.lelli@redhat.com, kasong@tencent.com, kernel-team@meta.com,
kprateek.nayak@amd.com, liam@infradead.org,
linux-kernel@vger.kernel.org, linux-mm@kvack.org, ljs@kernel.org,
matthew.brost@intel.com, mgorman@suse.de, mhocko@kernel.org,
mhocko@suse.com, mingo@redhat.com, muchun.song@linux.dev,
peterz@infradead.org, qi.zheng@linux.dev, rakie.kim@sk.com,
rientjes@google.com, roman.gushchin@linux.dev,
rostedt@goodmis.org, rppt@kernel.org, shakeel.butt@linux.dev,
surenb@google.com, tjmercier@google.com, vbabka@kernel.org,
vincent.guittot@linaro.org, vschneid@redhat.com,
weixugc@google.com, ying.huang@linux.alibaba.com,
yosry@kernel.org, yuanchu@google.com, ziy@nvidia.com
Subject: Re: [RFC PATCH v3 09/14] mm/memcontrol: Make memory.high tier-aware
Date: Tue, 18 Aug 2026 20:46:49 -0700 [thread overview]
Message-ID: <20260819034650.708665-1-joshua.hahnjy@gmail.com> (raw)
In-Reply-To: <20260818012115.65838-1-husong@kylinos.cn>
On Tue, 18 Aug 2026 09:21:15 +0800 Song Hu <husong@kylinos.cn> wrote:
Hi Song, thank you for your reply.
> (pre-existing, not from this series - mentioning it here because
> it reworks memory.high behaviour)
>
> The penalty computation in calculate_high_delay() can overflow:
>
> penalty_jiffies = max_overage * max_overage * HZ;
>
> max_overage is a fixed-point relative overage:
> calculate_overage() returns (usage - high) << 20 / high, so the
> square times HZ wraps once (usage - high) / high reaches
> 4096 / sqrt(HZ). That is roughly 130x at HZ=1000 and 259x at
> HZ=250 - reachable when memory.high is tightened far below the
> current usage of a large working set.
>
> Most wrapped values are still caught by the 2s clamp in
> mem_cgroup_handle_over_high(), but residues below the clamp pass
> through, and some of them produce far less throttling than
> intended - down to no sleep at all.
>
> check_mul_overflow() with a clamp would saturate the penalty
> instead of wrapping it. Could be folded in while memory.high is
> being reworked, or a standalone fix.
I think this could be a real concern, but I'm not sure that my series
is the right place to fold this change in. Namely because I don't
touch the penalty_jiffies / throttling part at all.
Maybe a standalone fix could be worth it? : -) I have no plans at the
moment so please feel free to take a crack at it if you think it's
a good idea!
Joshua
next prev parent reply other threads:[~2026-08-19 3:46 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-07 20:20 [RFC PATCH v3 00/14] Introduce tiered memcg limits Joshua Hahn
2026-08-07 20:20 ` [RFC PATCH v3 01/14] mm/memcontrol: Introduce cgroup.memory=tiered_limits boot parameter Joshua Hahn
2026-08-07 20:20 ` [RFC PATCH v3 02/14] mm/memcontrol: Refactor page_counter charging in try_charge_memcg Joshua Hahn
2026-08-07 20:20 ` [RFC PATCH v3 03/14] mm/memory-tiers: Introduce a mapping from nid to tier_slot Joshua Hahn
2026-08-07 20:20 ` [RFC PATCH v3 04/14] mm/memcontrol: Allocate per-tier page_counters Joshua Hahn
2026-08-07 20:20 ` [RFC PATCH v3 05/14] mm/memcontrol: Set tier limits proportional to memory limits Joshua Hahn
2026-08-07 20:20 ` [RFC PATCH v3 06/14] mm/vmscan, memcontrol: Add nodemask to try_to_free_mem_cgroup_pages Joshua Hahn
2026-08-07 20:20 ` [RFC PATCH v3 07/14] mm/memcontrol: Charge/uncharge tiered memory to mem_cgroup Joshua Hahn
2026-08-07 20:20 ` [RFC PATCH v3 08/14] mm/memcontrol: Make memory.low and memory.min tier-aware Joshua Hahn
2026-08-07 20:20 ` [RFC PATCH v3 09/14] mm/memcontrol: Make memory.high tier-aware Joshua Hahn
2026-08-18 1:21 ` Song Hu
2026-08-19 3:46 ` Joshua Hahn [this message]
2026-08-07 20:20 ` [RFC PATCH v3 10/14] mm/memcontrol: Make memory.max tier-aware Joshua Hahn
2026-08-07 20:20 ` [RFC PATCH v3 11/14] mm/memcontrol, migrate: Transfer tier charge on migration Joshua Hahn
2026-08-07 20:20 ` [RFC PATCH v3 12/14] mm/memcontrol: Kick async reclaim on migration and folio replacement Joshua Hahn
2026-08-07 20:20 ` [RFC PATCH v3 13/14] mm/memcontrol, sched/numa: Gate NUMA promotions into memcg tiers Joshua Hahn
2026-08-07 20:20 ` [RFC PATCH v3 14/14] mm/page_alloc: steer allocations away from exhausted memory tiers Joshua Hahn
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=20260819034650.708665-1-joshua.hahnjy@gmail.com \
--to=joshua.hahnjy@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=apopple@nvidia.com \
--cc=axelrasmussen@google.com \
--cc=baohua@kernel.org \
--cc=bsegall@google.com \
--cc=byungchul@sk.com \
--cc=cgroups@vger.kernel.org \
--cc=david@kernel.org \
--cc=dietmar.eggemann@arm.com \
--cc=gourry@gourry.net \
--cc=hannes@cmpxchg.org \
--cc=harry@kernel.org \
--cc=husong@kylinos.cn \
--cc=jackmanb@google.com \
--cc=juri.lelli@redhat.com \
--cc=kasong@tencent.com \
--cc=kernel-team@meta.com \
--cc=kprateek.nayak@amd.com \
--cc=liam@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=matthew.brost@intel.com \
--cc=mgorman@suse.de \
--cc=mhocko@kernel.org \
--cc=mhocko@suse.com \
--cc=mingo@redhat.com \
--cc=muchun.song@linux.dev \
--cc=peterz@infradead.org \
--cc=qi.zheng@linux.dev \
--cc=rakie.kim@sk.com \
--cc=rientjes@google.com \
--cc=roman.gushchin@linux.dev \
--cc=rostedt@goodmis.org \
--cc=rppt@kernel.org \
--cc=shakeel.butt@linux.dev \
--cc=surenb@google.com \
--cc=tjmercier@google.com \
--cc=vbabka@kernel.org \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
--cc=weixugc@google.com \
--cc=ying.huang@linux.alibaba.com \
--cc=yosry@kernel.org \
--cc=yuanchu@google.com \
--cc=ziy@nvidia.com \
/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
all inboxes | Powered by JetHome®