Re: perf: is it possible to userspace rdpmc but only on a certain core type
From: Vince Weaver
Date: Wed Jan 22 2025 - 16:51:37 EST
On Tue, 21 Jan 2025, Peter Zijlstra wrote:
> That's not race-free, the task can get migrated to an E core the moment
> after you done the load and before the rdpmc instruction.
>
> I suppose you can wrap the whole thing in RSEQ though, it's a bit of a
> pain, but RSEQ can be configured to abort on migration.
>
> The very latest libc (2.35+) should have rseq registered by default,
> older will have to do so itself -- there is example code in
> tools/testing/selftests/rseq but also
> https://git.kernel.org/pub/scm/libs/librseq/librseq.git
thanks, I had forgotten all about RSEQ, it's more or less exactly what we
were looking for.
I have a student working on this for PAPI. If we get it working we can
see if perf could use support too if it doesn't have it already.
Vince Weaver
vincent.weaver@xxxxxxxxx