From: Hui Zhu <hui.zhu@linux.dev>
To: Alireza Asgari <alireza@asgari.net>
Cc: netfilter-devel <netfilter-devel@vger.kernel.org>,
linux-mm <linux-mm@kvack.org>,
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>,
David Hildenbrand <david@kernel.org>,
Pablo Neira Ayuso <pablo@netfilter.org>,
Florian Westphal <fw@strlen.de>, Phil Sutter <phil@nwl.cc>,
Shuah Khan <shuah@kernel.org>, Tejun Heo <tj@kernel.org>,
Vladimir Davydov <vdavydov.dev@gmail.com>,
Chris Down <chris@chrisdown.name>,
Zhang Jiao <zhangjiao2@cmss.chinamobile.com>,
Song Hu <husong@kylinos.cn>, cgroups <cgroups@vger.kernel.org>,
netdev <netdev@vger.kernel.org>,
linux-kselftest <linux-kselftest@vger.kernel.org>
Subject: Re: [PATCH RFC nf-next 2/9] memcg: bound memory.high delay arithmetic
Date: Fri, 4 Dec 2026 15:21:08 +0800 [thread overview]
Message-ID: <2dfe4f8e-e87d-444f-b3c6-a6acd615013b@linux.dev> (raw)
In-Reply-To: <1a239b2ca50.36a66e22694686.5140051424523797730@asgari.net>
2026/12/3 10:19, Alireza Asgari:
> Hi Hui and Zhang Jiao,
>
> I saw your discussion about combining the memory.high fixes here:
> https://lists.openwall.net/linux-kernel/2026/11/18/558
>
> I worked on the same delay calculation in my NFQUEUE RFC. One case
> that might be useful for your combined fix is a task with one page of
> deferred debt when usage is three times memory.high. At HZ=250 the
> expected delay after the final clamp is 500 jiffies (two seconds).
>
> The case is in memcg_high_test_delay() in patch 3 of my RFC.
> https://lore.kernel.org/all/20261115-b4-nfqueue-memory-accounting-v1-3-b9cc30819997@asgari.net/
>
> Would it be useful if I adapted that test for your series?
>
> Thanks,
> Alireza
>
Hi Alireza,
Yes, please -- that would be very useful. Your case (nr_pages=1, usage=3x
high, 500 jiffies at HZ=250) is a good baseline for the normal path and the
final clamp, and would catch any unintended behaviour change from the
rework.
Could you also add a case that triggers the u64 overflow, which is what 2/2
fixes? Once usage is far enough over high, max_overage * max_overage * HZ
wraps and the penalty can come out small or even zero. The changelog's
example is memory.high = 1 page with usage = 2049 pages (max_overage =
2^31); the unpatched code wraps there, while the fix should saturate at
MEMCG_MAX_HIGH_DELAY_JIFFIES. Asserting the delay is 2*HZ for that case
would cover the overflow directly.
I've just sent v2 of the series and Cc'd you on it. Happy to review the
adapted test.
Best,
Hui
next prev parent reply other threads:[~2026-12-04 7:21 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-15 22:34 [PATCH RFC nf-next 0/9] netfilter: nfqueue: account queued memory and reserve capacity Alireza Asgari via B4 Relay
2026-11-15 22:34 ` [PATCH RFC nf-next 1/9] memcg: saturate deferred memory.high page debt Alireza Asgari via B4 Relay
2026-12-03 2:11 ` Alireza Asgari
2026-11-15 22:34 ` [PATCH RFC nf-next 2/9] memcg: bound memory.high delay arithmetic Alireza Asgari via B4 Relay
2026-12-03 2:19 ` Alireza Asgari
2026-12-04 7:21 ` Hui Zhu [this message]
2026-11-15 22:34 ` [PATCH RFC nf-next 3/9] memcg: add KUnit coverage for memory.high accounting Alireza Asgari via B4 Relay
2026-11-15 22:34 ` [PATCH RFC nf-next 4/9] memcg: add an owner-bound capacity reservation interface Alireza Asgari via B4 Relay
2026-11-15 22:34 ` [PATCH RFC nf-next 5/9] memcg: test capacity reservation rollback and refunds Alireza Asgari via B4 Relay
2026-11-15 22:34 ` [PATCH RFC nf-next 6/9] netfilter: nfqueue: account saved skb bytes per queue Alireza Asgari via B4 Relay
2026-11-16 22:46 ` Florian Westphal
2026-12-03 1:08 ` Alireza Asgari
2026-11-15 22:34 ` [PATCH RFC nf-next 7/9] netfilter: nfqueue: reserve capacity against the bound owner Alireza Asgari via B4 Relay
2026-11-16 23:17 ` Florian Westphal
2026-12-03 1:17 ` Alireza Asgari
2026-11-15 22:34 ` [PATCH RFC nf-next 8/9] netfilter: nfqueue: add KUnit memory accounting coverage Alireza Asgari via B4 Relay
2026-11-15 22:34 ` [PATCH RFC nf-next 9/9] selftests: netfilter: exercise nfqueue memory accounting Alireza Asgari via B4 Relay
2026-11-16 22:34 ` sashiko-bot
2026-12-03 1:41 ` Alireza Asgari
2026-11-18 3:38 ` [PATCH RFC nf-next 0/9] netfilter: nfqueue: account queued memory and reserve capacity Chris Down
2026-12-03 1:24 ` Alireza Asgari
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=2dfe4f8e-e87d-444f-b3c6-a6acd615013b@linux.dev \
--to=hui.zhu@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=alireza@asgari.net \
--cc=cgroups@vger.kernel.org \
--cc=chris@chrisdown.name \
--cc=david@kernel.org \
--cc=fw@strlen.de \
--cc=hannes@cmpxchg.org \
--cc=husong@kylinos.cn \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=muchun.song@linux.dev \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=phil@nwl.cc \
--cc=roman.gushchin@linux.dev \
--cc=shakeel.butt@linux.dev \
--cc=shuah@kernel.org \
--cc=tj@kernel.org \
--cc=vdavydov.dev@gmail.com \
--cc=zhangjiao2@cmss.chinamobile.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