From: Kuniyuki Iwashima <kuniyu@google.com>
To: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Johannes Weiner <hannes@cmpxchg.org>,
Michal Hocko <mhocko@kernel.org>,
Roman Gushchin <roman.gushchin@linux.dev>,
Muchun Song <muchun.song@linux.dev>,
Kuniyuki Iwashima <kuni1840@gmail.com>,
linux-mm@kvack.org, cgroups@vger.kernel.org, yosry@kernel.org,
joannelkoong@gmail.com
Subject: Re: [PATCH v2 0/6] memcg: Batch mod_memcg_state() for MEMCG_SOCK.
Date: Thu, 29 Oct 2026 20:26:21 +0000 [thread overview]
Message-ID: <auOqQJQUKitt86XJ@google.com> (raw)
In-Reply-To: <auOlmxtQ5-EZTj62@linux.dev>
On Thu, 29 Oct 2026 13:02:08 -0700, Shakeel Butt wrote:
> On Thu, Oct 29, 2026 at 01:35:18AM +0000, Kuniyuki Iwashima wrote:
> > On Wed, 28 Oct 2026 17:52:32 -0700, Shakeel Butt wrote:
> [...]
> > > >
> > > > For the 4th patch, I would prefer we first try to move the network sockets
> > > > from memcg to objcg path.
> >
> > sk_forward_alloc is already batched per page, and I think
> > migrating to objcg would just add an indirect layer and some
> > costs for css_tryget() / css_put(), and still inlining
> > __consume_stock() or batching in memcg_stock would be crucial.
> >
>
> We are over time moving kernel objects holding direct reference to memcg to the
> objcg infra and the reason is such objects can become source of zombie memcgs.
> There is no urgency for the network sockets but eventually it will happen. We
> will see if indirection is really measurable at that time.
I tried it yesterday and saw ~5% regression w/ tcp_rr 10k/20k flows,
https://github.com/q2ven/linux/commit/7407580c37784bf594fede4d6da6b266d8c7a11d
but optimising stats limited it to ~2%.
https://github.com/q2ven/linux/commit/1ffc01395156b278c3d1c9c5fff7b9484f632be8
Given the perf gain by this series, I guess it's acceptable
and I can post it to net-next once merge window opens.
(rstats patch will be a follow-up after v3)
prev parent reply other threads:[~2026-10-29 20:26 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-28 18:50 [PATCH v2 0/6] memcg: Batch mod_memcg_state() for MEMCG_SOCK Kuniyuki Iwashima
2026-10-28 18:50 ` [PATCH v2 1/6] memcg: Remove unnecessary READ_ONCE() under memcg_stock.lock Kuniyuki Iwashima
2026-10-29 0:48 ` Shakeel Butt
2026-10-29 1:44 ` Kuniyuki Iwashima
2026-10-28 18:50 ` [PATCH v2 2/6] memcg: Reduce nesting in consume_stock() and refill_stock() Kuniyuki Iwashima
2026-10-29 0:50 ` Shakeel Butt
2026-10-28 18:50 ` [PATCH v2 3/6] memcg: Annotate slow paths " Kuniyuki Iwashima
2026-10-29 0:55 ` Shakeel Butt
2026-10-29 1:49 ` Kuniyuki Iwashima
2026-10-28 18:50 ` [PATCH v2 4/6] memcg: Batch mod_memcg_state() for MEMCG_SOCK Kuniyuki Iwashima
2026-10-28 18:50 ` [PATCH v2 5/6] memcg: Uncharge pages outside memcg_stock.lock in __refill_stock() Kuniyuki Iwashima
2026-10-28 18:50 ` [PATCH v2 6/6] selftests: cgroup: Deflake test_memcg_sock() in test_memcontrol.c Kuniyuki Iwashima
2026-10-29 0:41 ` [PATCH v2 0/6] memcg: Batch mod_memcg_state() for MEMCG_SOCK Shakeel Butt
2026-10-29 0:52 ` Shakeel Butt
2026-10-29 1:35 ` Kuniyuki Iwashima
2026-10-29 2:32 ` Kuniyuki Iwashima
2026-10-29 20:02 ` Shakeel Butt
2026-10-29 20:26 ` Kuniyuki Iwashima [this message]
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=auOqQJQUKitt86XJ@google.com \
--to=kuniyu@google.com \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=joannelkoong@gmail.com \
--cc=kuni1840@gmail.com \
--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=yosry@kernel.org \
/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