From: Tim Chen <tim.c.chen@linux.intel.com>
To: "Liang, Kan" <kan.liang@linux.intel.com>,
peterz@infradead.org, mingo@kernel.org,
linux-kernel@vger.kernel.org
Cc: acme@kernel.org, namhyung@kernel.org, irogers@google.com,
eranian@google.com, ak@linux.intel.com, yunying.sun@intel.com
Subject: Re: [PATCH 1/8] perf/x86/uncore: Save the unit control address of all units
Date: Wed, 12 Jun 2024 10:33:05 -0700 [thread overview]
Message-ID: <47fad008a152957c87e9846fdbf40746b6e2871a.camel@linux.intel.com> (raw)
In-Reply-To: <eb5d91d1-2898-45e0-a2d3-aa5c66155911@linux.intel.com>
On Wed, 2024-06-12 at 10:49 -0400, Liang, Kan wrote:
>
>
> The id and pmu_idx+die can all be used as a key to search the RB tree in
> different places.
>
> The id is the physical ID of a unit. The search via id is invoked when
> adding a new unit. Perf needs to make sure that the same PMU idx
> (logical id) is assigned to the unit with the same physical ID. Because
> the units with the same physical ID in different dies share the same PMU.
This info about having same physical ID implies the same PMU
is worth mentioning in a comment and will be quite helpful in
understanding the rb-tree organization.
Thanks.
Tim
>
> The pmu_idx+die key is used when setting the cpumask. Please see
> intel_uncore_find_discovery_unit_id() in the patch 2. Perf wants to
> understand on which dies the given PMU is available.
>
> Since different keys can be used to search the RB tree, I think one of
> them has to traverse the whole tree. At the stage of adding a new unit,
> the tree is not complete yet. It minimizes the impact of the O(N)
> search. So I choose the pmu_idx+die rather than id.
>
> Also, the driver only does once to build the tree and set the cpumask at
> driver load time. I think the O(N) should be acceptable here.
>
> Thanks,
> Kan
next prev parent reply other threads:[~2024-06-12 17:33 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-10 20:16 [PATCH 0/8] Support HBM and CXL PMON uncore counters kan.liang
2024-06-10 20:16 ` [PATCH 1/8] perf/x86/uncore: Save the unit control address of all units kan.liang
2024-06-10 22:40 ` Tim Chen
2024-06-12 14:49 ` Liang, Kan
2024-06-12 17:08 ` Tim Chen
2024-06-12 17:33 ` Tim Chen [this message]
2024-06-12 19:25 ` Liang, Kan
2024-06-10 20:16 ` [PATCH 2/8] perf/x86/uncore: Support per PMU cpumask kan.liang
2024-06-10 20:16 ` [PATCH 3/8] perf/x86/uncore: Retrieve the unit ID from the unit control RB tree kan.liang
2024-06-10 20:16 ` [PATCH 4/8] perf/x86/uncore: Apply the unit control RB tree to MMIO uncore units kan.liang
2024-06-10 20:16 ` [PATCH 5/8] perf/x86/uncore: Apply the unit control RB tree to MSR " kan.liang
2024-06-10 20:16 ` [PATCH 6/8] perf/x86/uncore: Apply the unit control RB tree to PCI " kan.liang
2024-06-10 20:16 ` [PATCH 7/8] perf/x86/uncore: Cleanup unused unit structure kan.liang
2024-06-10 20:16 ` [PATCH 8/8] perf/x86/intel/uncore: Support HBM and CXL PMON counters kan.liang
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=47fad008a152957c87e9846fdbf40746b6e2871a.camel@linux.intel.com \
--to=tim.c.chen@linux.intel.com \
--cc=acme@kernel.org \
--cc=ak@linux.intel.com \
--cc=eranian@google.com \
--cc=irogers@google.com \
--cc=kan.liang@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=yunying.sun@intel.com \
/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