diff options
| author | Usama Arif <usama.arif@linux.dev> | 2026-09-21 08:30:15 -0700 |
|---|---|---|
| committer | Peter Zijlstra <peterz@infradead.org> | 2026-09-25 12:45:55 +0200 |
| commit | 6350de8671b94afb7691d110f63bcda42f658a69 (patch) | |
| tree | 98f82e8dcb43906db18d6ab7dbdb0f605c2b56a4 /include/uapi/linux | |
| parent | 4a8557a4e5d2d5f96a989a428e38569451e74405 (diff) | |
| download | linux-next-6350de8671b94afb7691d110f63bcda42f658a69.tar.gz linux-next-6350de8671b94afb7691d110f63bcda42f658a69.zip | |
perf/x86/amd/uncore: Free counter slot by index
amd_uncore_del() scans ctx->events[] from slot zero and attempts a
compare-exchange until it finds the event.
amd_uncore_add() records the slot it claimed in event->hw.idx. Perf
calls ->del() only after a successful ->add(), and the driver never
moves an installed event between slots. The index therefore remains
valid until deletion.
Use the recorded index directly and retain the compare-exchange
ownership check. Warn if it fails, as that means the driver lost track
of the slot.
Deleting all events from a full PMU with N counters now requires N
compare-exchanges instead of N * (N + 1) / 2.
On a host running a production workload in the Meta fleet, amd_uncore_del()
was called 56,575 times per second from mux rotation.
Signed-off-by: Usama Arif <usama.arif@linux.dev>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Sandipan Das <sandipan.das@amd.com>
Link: https://patch.msgid.link/20260921153108.2713179-3-usama.arif@linux.dev
Diffstat (limited to 'include/uapi/linux')
0 files changed, 0 insertions, 0 deletions
