The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Tom Gebhardt <tomge68@gmail.com>
To: Qais Yousef <qyousef@layalina.io>
Cc: linux-kernel@vger.kernel.org,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>
Subject: Re: [PATCH v2 00/13] sched/fair/schedutil: Better manage system response time
Date: Thu, 28 May 2026 14:50:48 +0200	[thread overview]
Message-ID: <b11492da1bf07b0e823c4672d2dab447.tomge68@gmail.com> (raw)
In-Reply-To: <20260516030123.o26tbwwqeetvo5ix@airbuntu>

Hi Qais,

Thanks for the clarification on sched-analyzer -- I'll look at the perfetto
approach for task placement traces.

In the meantime, I ran `perf stat` and `perf record -g` across three kernels
at OC (2800 MHz) with `ondemand` governor, using the same stress-ng pipe
workload (4 workers, 20s).

Device: Raspberry Pi 5 (8 GB, C1-stepping, Cortex-A76), Bookworm arm64.

perf stat results:

  Metric              6.6.78     7.0 stock   7.0+ttwu+vincent
  ------------------  ---------  ----------  ----------------
  bogo ops/s          2 222 639  1 855 066   2 298 965
  IPC                 1.72       1.47        1.76
  branch-misses       625M       1 270M      1 018M
  context-switches    15 145 738 22 750 121  18 905 924
  cache-miss rate     1.58%      1.74%       1.38%

Key observations:

1. IPC drops 14% on 7.0 stock (1.72 -> 1.47). ttwu+vincent recovers it
   almost completely (1.76, slightly above 6.6). This is a genuine
   efficiency loss in the scheduler path, not a throughput/clock artifact.

2. Branch mispredictions double on 7.0 stock (+103% vs 6.6). ttwu+vincent
   reduces them by ~20% vs stock, but +63% above 6.6 remains -- this
   likely explains the residual ~1% gap after patching.

3. Context switches increase 50% on 7.0 stock. ttwu+vincent brings this
   down to +25% vs 6.6.

perf report (-g) highlights:

On 6.6, `finish_task_switch` is barely visible in call graphs. On 7.0
(both stock and patched), it appears prominently at 5-8% of samples,
alongside elevated `_raw_spin_unlock_irqrestore` time. This points to
genuine overhead in the context switch completion path, not lock contention
between worker tasks.

Regarding the "weird contention accidentally hidden" concern: I don't see
evidence for that. The branch miss explosion and IPC drop on 7.0 stock are
consistent with more complex/harder-to-predict scheduler control flow
(EEVDF decision tree vs. CFS), not with a workload contention pattern that
happens to be masked by task placement changes. ttwu+vincent genuinely
reduces branch misses and restores IPC -- it doesn't just move the problem.

I'll try to get perfetto traces for the task placement / running vs.
runnable time breakdown. Happy to provide the raw perf.data files if
useful.

Tom

  reply	other threads:[~2026-05-28 12:50 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-04  1:59 [PATCH v2 00/13] sched/fair/schedutil: Better manage system response time Qais Yousef
2026-05-04  1:59 ` [PATCH v2 01/13] sched: cpufreq: Rename map_util_perf to sugov_apply_dvfs_headroom Qais Yousef
2026-05-04  1:59 ` [PATCH v2 02/13] sched/pelt: Add a new function to approximate the future util_avg value Qais Yousef
2026-05-04  1:59 ` [PATCH v2 03/13] sched/pelt: Add a new function to approximate runtime to reach given util Qais Yousef
2026-06-04  8:50   ` Vincent Guittot
2026-05-04  1:59 ` [PATCH v2 04/13] sched/fair: Remove magic hardcoded margin in fits_capacity() Qais Yousef
2026-06-04 10:08   ` Vincent Guittot
2026-05-04  1:59 ` [PATCH v2 05/13] sched: cpufreq: Remove magic 1.25 headroom from sugov_apply_dvfs_headroom() Qais Yousef
2026-05-04  1:59 ` [PATCH v2 06/13] sched/fair: Extend util_est to improve rampup time Qais Yousef
2026-05-04  1:59 ` [PATCH v2 07/13] sched/fair: util_est: Take into account periodic tasks Qais Yousef
2026-05-04  1:59 ` [PATCH v2 RFC 08/13] sched/qos: Add a new sched-qos interface Qais Yousef
2026-05-06 20:38   ` Tim Chen
2026-05-07  9:55     ` Qais Yousef
2026-05-07 14:20       ` Chen, Yu C
2026-05-09  9:39         ` Qais Yousef
2026-05-11 10:57   ` Peter Zijlstra
2026-05-12  7:58     ` Qais Yousef
2026-05-12  8:30       ` Peter Zijlstra
2026-05-12  8:47         ` Qais Yousef
2026-05-19  9:47   ` Peter Zijlstra
2026-05-19 10:56     ` Qais Yousef
2026-05-04  1:59 ` [PATCH v2 09/13] sched/qos: Add rampup multiplier QoS Qais Yousef
2026-05-11 11:03   ` Peter Zijlstra
2026-05-12  7:59     ` Qais Yousef
2026-05-12  8:37       ` Christian Loehle
2026-05-12  8:53         ` Qais Yousef
2026-05-04  2:00 ` [PATCH v2 10/13] sched/fair: Disable util_est when rampup_multiplier is 0 Qais Yousef
2026-05-04  2:00 ` [PATCH v2 11/13] sched/fair: Don't mess with util_avg post init Qais Yousef
2026-05-04  2:00 ` [PATCH v2 12/13] sched/fair: Call update_util_est() after dequeue_entities() Qais Yousef
2026-05-04  2:00 ` [PATCH v2 RFC 13/13] sched/pelt: Always allow load updates Qais Yousef
2026-05-11 17:58 ` [PATCH v2 00/13] sched/fair/schedutil: Better manage system response time John Stultz
2026-05-12  8:01   ` Qais Yousef
2026-05-13 15:09 ` Tom Gebhardt
2026-05-15  1:42   ` Qais Yousef
2026-05-15  8:24     ` Tom Gebhardt
2026-05-15 10:01       ` Christian Loehle
2026-05-15 13:57         ` Tom Gebhardt
2026-05-16 13:43           ` Christian Loehle
2026-05-19  7:46             ` Tom Gebhardt
2026-05-25  7:25             ` Tom Gebhardt
2026-05-28  7:38               ` Christian Loehle
2026-05-28 11:08                 ` Tom Gebhardt
2026-05-16  3:01       ` Qais Yousef
2026-05-28 12:50         ` Tom Gebhardt [this message]
2026-05-29  1:43           ` Qais Yousef
2026-05-29  7:53             ` Tom Gebhardt
2026-05-31  2:35               ` Qais Yousef

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=b11492da1bf07b0e823c4672d2dab447.tomge68@gmail.com \
    --to=tomge68@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=qyousef@layalina.io \
    --cc=vincent.guittot@linaro.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