Linux Perf Users
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Antoine Huret" <antoine.huret@bull.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH] perf/core: Update cgroup time when rotating multiplexed events
Date: Thu, 15 Oct 2026 13:05:12 +0000	[thread overview]
Message-ID: <sashiko-outbox-172895@kernel.org> (raw)
In-Reply-To: <20261015-perf-cgroup-rotation-time-v1-1-93e177dfee5d@bull.com>

> From: Antoine Huret <antoine.huret@bull.com>
> 
> Since commit bd2756811766 ("perf: Rewrite core context handling"),
> perf_rotate_context() only updates the context time before scheduling
> out the flexible events. It no longer updates the cgroup time, which
> ctx_sched_out() used to do.
> 
> Cgroup events take their times from the per-cpu cgroup clock, so
> between two cgroup switches the rotations see a frozen clock. The
> events rotated out lose the running time they accumulated, and the next
> update, usually a read, credits the whole interval to the events that
> happen to be on the PMU at that moment.
> 
> As a result, the time_running of multiplexed cgroup events is wrong,
> and so are their scaled counts, as long as no other cgroup runs on the
> CPU, e.g. a busy job alone on its CPUs. Counting cycles over one second
> of a busy loop in a cgroup gives from half to several times the max
> frequency of the CPU.
> 
> Update the cgroup time before rotating the CPU context, as was done
> before the rewrite.
> 
> Fixes: bd2756811766 ("perf: Rewrite core context handling")
> Closes: https://lore.kernel.org/r/PR3PR07MB69223331EED5BEBE150375B7849C2@PR3PR07MB6922.eurprd07.prod.outlook.com/
> Cc: stable@vger.kernel.org
> Assisted-by: Claude:claude-opus-5-5
> Signed-off-by: Antoine Huret <antoine.huret@bull.com>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261015-perf-cgroup-rotation-time-v1-1-93e177dfee5d@bull.com?part=1


      reply	other threads:[~2026-10-15 13:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-15 12:55 [PATCH] perf/core: Update cgroup time when rotating multiplexed events Antoine Huret via B4 Relay
2026-10-15 13:05 ` sashiko-bot [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=sashiko-outbox-172895@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=antoine.huret@bull.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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