[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <47fad008a152957c87e9846fdbf40746b6e2871a.camel@linux.intel.com>
Date: Wed, 12 Jun 2024 10:33:05 -0700
From: Tim Chen <tim.c.chen@...ux.intel.com>
To: "Liang, Kan" <kan.liang@...ux.intel.com>, peterz@...radead.org,
mingo@...nel.org, linux-kernel@...r.kernel.org
Cc: acme@...nel.org, namhyung@...nel.org, irogers@...gle.com,
eranian@...gle.com, ak@...ux.intel.com, yunying.sun@...el.com
Subject: Re: [PATCH 1/8] perf/x86/uncore: Save the unit control address of
all units
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
Powered by blists - more mailing lists