From: sashiko-bot@kernel.org
To: "Usama Arif" <usama.arif@linux.dev>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH 2/2] perf/x86/amd/uncore: Free counter slot by index
Date: Mon, 21 Sep 2026 15:38:12 +0000 [thread overview]
Message-ID: <20260921153813.1B8BA1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260921153108.2713179-3-usama.arif@linux.dev>
> 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.
>
> Cc: Sandipan Das <sandipan.das@amd.com>
> Signed-off-by: Usama Arif <usama.arif@linux.dev>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260921153108.2713179-1-usama.arif@linux.dev?part=2
next prev parent reply other threads:[~2026-09-21 15:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-21 15:30 [PATCH 0/2] perf/x86/amd/uncore: Drop redundant counter slot searches Usama Arif
2026-09-21 15:30 ` [PATCH 1/2] perf/x86/amd/uncore: Remove redundant event slot scan Usama Arif
2026-09-21 15:36 ` sashiko-bot
2026-09-21 15:30 ` [PATCH 2/2] perf/x86/amd/uncore: Free counter slot by index Usama Arif
2026-09-21 15:38 ` sashiko-bot [this message]
2026-09-23 10:38 ` [PATCH 0/2] perf/x86/amd/uncore: Drop redundant counter slot searches Sandipan Das
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=20260921153813.1B8BA1F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=usama.arif@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