From: "Michal Koutný" <mkoutny@suse.com>
To: Greg Thelen <gthelen@google.com>
Cc: Tejun Heo <tj@kernel.org>, Johannes Weiner <hannes@cmpxchg.org>,
Andrew Morton <akpm@linux-foundation.org>,
Yosry Ahmed <yosryahmed@google.com>,
cgroups@vger.kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, Eric Dumazet <edumazet@google.com>
Subject: Re: [PATCH] cgroup/rstat: avoid disabling irqs for O(num_cpu)
Date: Wed, 19 Mar 2025 11:20:26 +0100 [thread overview]
Message-ID: <mvpuegbh5gttbflarqua5wa7ar42zy5d6hxqf7me6nxwk7yibm@bxwxkt4h5fx5> (raw)
In-Reply-To: <20250319071330.898763-1-gthelen@google.com>
[-- Attachment #1: Type: text/plain, Size: 1594 bytes --]
Hello.
On Wed, Mar 19, 2025 at 12:13:30AM -0700, Greg Thelen <gthelen@google.com> wrote:
> cgroup_rstat_flush_locked() grabs the irq safe cgroup_rstat_lock while
> iterating all possible cpus. It only drops the lock if there is
> scheduler or spin lock contention. If neither, then interrupts can be
> disabled for a long time. On large machines this can disable interrupts
> for a long enough time to drop network packets. On 400+ CPU machines
> I've seen interrupt disabled for over 40 msec.
This is peanuts, watchdog_thresh defaults to 10000 msec.
(Tongue-in-cheek, to put that threshold into relation but I see the
problem.)
> The mode of memory.stat access latency after grouping by of 2 buckets:
power
> - without memory hogs: 64 usec => 16 usec
> - with memory hogs: 64 usec => 8 usec
> The memory.stat latency improves.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Signed-off-by: Greg Thelen <gthelen@google.com>
> Tested-by: Greg Thelen <gthelen@google.com>
> ---
> kernel/cgroup/rstat.c | 12 +++++-------
> 1 file changed, 5 insertions(+), 7 deletions(-)
FTR, the lock may end up split per-subsys [1] but this would still make
sense for memcg's one. (I wonder if Tejun would consider it small enough
then to avoid interrupt disabling. Then this could be converted to more
widely used cond_resched_lock().)
[1] https://lore.kernel.org/r/20250227215543.49928-4-inwardvessel@gmail.com/
But all in all, thanks for this and
Acked-by: Michal Koutný <mkoutny@suse.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2025-03-19 10:20 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-19 7:13 Greg Thelen
2025-03-19 7:17 ` Greg Thelen
2025-03-19 10:20 ` Michal Koutný [this message]
2025-03-19 10:47 ` Mateusz Guzik
2025-03-19 17:18 ` Yosry Ahmed
2025-03-27 14:38 ` Mateusz Guzik
2025-03-27 17:17 ` Yosry Ahmed
2025-03-27 17:47 ` Mateusz Guzik
2025-04-01 15:00 ` Michal Koutný
2025-04-01 15:46 ` Mateusz Guzik
2025-04-01 16:59 ` Michal Koutný
2025-03-19 17:26 ` Tejun Heo
2025-03-26 23:57 ` Mateusz Guzik
2025-03-19 17:16 ` Yosry Ahmed
2025-03-19 18:06 ` Johannes Weiner
2025-03-19 18:35 ` Yosry Ahmed
2025-03-19 19:10 ` Tejun Heo
2025-03-19 19:16 ` Johannes Weiner
2025-03-19 19:46 ` Johannes Weiner
2025-03-19 17:26 ` Tejun Heo
2025-03-19 17:35 ` Johannes Weiner
2025-03-19 17:53 ` Shakeel Butt
2025-03-19 18:37 ` Eric Dumazet
2025-03-20 14:43 ` Greg Thelen
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=mvpuegbh5gttbflarqua5wa7ar42zy5d6hxqf7me6nxwk7yibm@bxwxkt4h5fx5 \
--to=mkoutny@suse.com \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=edumazet@google.com \
--cc=gthelen@google.com \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=tj@kernel.org \
--cc=yosryahmed@google.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