mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Chris Mason <clm@meta.com>,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@kernel.org>,
	vschneid@redhat.com, Juri Lelli <juri.lelli@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: scheduler performance regression since v6.11
Date: Fri, 23 May 2025 17:40:31 +0200	[thread overview]
Message-ID: <20250523154031.GM39944@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20250522150035.GB1065351@cmpxchg.org>

On Thu, May 22, 2025 at 11:00:35AM -0400, Johannes Weiner wrote:

> Ah right, since all the ancestor walks would ultimately end up at the
> system's seq anyway. And always have, really.
> 
> It does stretch the critical section, of course.

Right, with a cost proportional to the depth of the cgroup tree. So deep
trees will have it worse.

> I ran perf bench
> sched messaging to saturate all CPUs in state changes and then read a
> pressure file 1000x. This is on a 32-way machine:
> 
>      0.18%     +1.34%  [kernel.kallsyms]     [k] collect_percpu_times
> 
> and annotation shows it's indeed retrying on the seq-read a bit more.
> 
> But that seems well within tolerance, and obviously worth it assuming
> it fixes the cpu_clock() regression on the sched side.

Right, it appears it does :-)

> At that point, though, it probably makes sense to move seq out of
> psi_group_cpu altogether? More for clarity, really - it won't save
> much right away given that deliberate 2-cacheline-layout.
> 
> /* Serializes task state changes against aggregation runs */
> static DEFINE_PER_CPU(seqcount_t, psi_seq);

Sure, let me do that.

> Otherwise, the patch looks great to me. Thanks for including a couple
> of cleanups as well.

Yeah, mostly due to the back and forth -- my earlier ugly hack added
more tree iterations and me being lazy I didn't want to type all that
out :-)

Also, I've been migrating to using neovim with clangd language server,
and that doesn't much like the weird scheduler build setup, so I added
sufficient headers for the thing to 'compile' as a stand alone unit
(which is what clangd does).

I'll break out this patch and clean up all the sched bits to be clangd
clean -- I've been sitting on that patch long enough.

> Acked-by: Johannes Weiner <hannes@cmpxchg.org>

Thanks!

  reply	other threads:[~2025-05-23 15:40 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-07 23:13 Chris Mason
2025-05-09 19:49 ` Peter Zijlstra
2025-05-12 18:08   ` Peter Zijlstra
2025-05-12 19:39     ` Chris Mason
2025-05-12 22:35       ` Chris Mason
2025-05-13  7:15         ` Peter Zijlstra
2025-05-16 10:18         ` Peter Zijlstra
2025-05-20 14:38           ` Dietmar Eggemann
2025-05-20 14:53             ` Chris Mason
2025-05-21 13:59               ` Dietmar Eggemann
2025-05-21 14:32                 ` Chris Mason
2025-05-20 19:38             ` Peter Zijlstra
2025-05-21 14:02               ` Dietmar Eggemann
2025-05-21 15:02                 ` Peter Zijlstra
2025-05-21 19:00                   ` Peter Zijlstra
2025-05-21 14:54               ` Peter Zijlstra
2025-05-22  8:48                 ` Peter Zijlstra
2025-05-22 15:00                   ` Johannes Weiner
2025-05-23 15:40                     ` Peter Zijlstra [this message]
2025-05-23 12:27                   ` Dietmar Eggemann
2025-07-10 12:46                   ` [tip: sched/core] sched/psi: Optimize psi_group_change() cpu_clock() usage tip-bot2 for Peter Zijlstra

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=20250523154031.GM39944@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=clm@meta.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=hannes@cmpxchg.org \
    --cc=juri.lelli@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=vschneid@redhat.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®