From: Jing Wu <realwujing@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Jing Wu <realwujing@gmail.com>, Thomas Gleixner <tglx@kernel.org>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
"Paul E. McKenney" <paulmck@kernel.org>,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
linux-kernel@vger.kernel.org,
Qiliang Yuan <yuanql9@chinatelecom.cn>,
Jian Zhang <zhangj332@chinatelecom.cn>
Subject: Re: [PATCH] x86/aperfmperf: Refresh stale sample via IPI for busy NOHZ_FULL CPUs
Date: Wed, 29 Jul 2026 16:22:24 +0800 [thread overview]
Message-ID: <20260729082225.1675233-1-realwujing@gmail.com> (raw)
In-Reply-To: <20260728144224.GH651302@noisy.programming.kicks-ass.net>
On Tue, Jul 28, 2026 at 04:42:24PM +0200, Peter Zijlstra wrote:
> Aside from the fact that sending IPIs to NOHZ_FULL is just plain wrong,
> this whole thing makes no sense.
>
> When the CPU is isolated, nothing should care about the ratio anyway.
> Just set the thing to '1' (1024) when the CPU enters NOHZ_FULL mode and
> ensure it isn't ever modified.
Fair, understood.
For context on why I went looking in the first place: stressing an
isolated, nohz_full CPU shows both /proc/cpuinfo's "cpu MHz" and
/sys/devices/system/cpu/cpuN/cpufreq/scaling_cur_freq stuck at the
P-state floor (e.g. 800MHz) for as long as the CPU stays busy and
isolated, while turbostat confirms the hardware is actually running
at full turbo (e.g. 3.2GHz) the whole time. Both interfaces go
through arch_freq_get_on_cpu(), so whatever affects one affects both.
Getting the exact value would need an on-demand rdmsr on the target
CPU - which is what turbostat itself does via /dev/cpu/N/msr's
rdmsr_safe_regs_on_cpu(), i.e. the same smp_call_function_single()
IPI, just triggered manually by a human running a diagnostic tool
instead of sitting behind a commonly-polled sysfs file.
I looked for a way around that: PCU mailbox telemetry can expose a
per-core P-state on some Xeon uncores without touching the target
CPU, and HFI publishes a shared table too, but that's a per-core
performance/efficiency class, not an achieved clock, and PCU access
is uncore/generation-specific, not a general mechanism. So as far as
I can tell there's no way to get the exact value for an isolated CPU
without an IPI of some form.
Thanks,
Jing Wu
next prev parent reply other threads:[~2026-07-29 8:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-28 11:27 Jing Wu
2026-07-28 13:44 ` Peter Zijlstra
2026-07-28 14:42 ` Peter Zijlstra
2026-07-29 8:22 ` Jing Wu [this message]
2026-07-29 12:39 ` Peter Zijlstra
2026-07-29 13:04 ` Jing Wu
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=20260729082225.1675233-1-realwujing@gmail.com \
--to=realwujing@gmail.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=paulmck@kernel.org \
--cc=peterz@infradead.org \
--cc=rafael.j.wysocki@intel.com \
--cc=tglx@kernel.org \
--cc=x86@kernel.org \
--cc=yuanql9@chinatelecom.cn \
--cc=zhangj332@chinatelecom.cn \
/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®