[PATCH 0/3] Cleanup for Intel PMU initialization

kan.liang@linux.intel.com posted 3 patches 1 year ago
arch/x86/events/core.c            |  10 +--
arch/x86/events/intel/core.c      | 134 +++++++++++++++---------------
arch/x86/events/intel/ds.c        |  10 ++-
arch/x86/events/perf_event.h      |   1 +
arch/x86/include/asm/perf_event.h |  28 ++++++-
5 files changed, 106 insertions(+), 77 deletions(-)
[PATCH 0/3] Cleanup for Intel PMU initialization
Posted by kan.liang@linux.intel.com 1 year ago
From: Kan Liang <kan.liang@linux.intel.com>

The patches are to clean up different features. They all touch the
initialization code. There are some dependencies. So I put them in
a patch set to facilitate the review and merge.

Patch 1 is to clear up the PEBS-via-PT on hybrid.
The original V1 patch can be found at
https://lore.kernel.org/lkml/20250124183432.3565061-1-kan.liang@linux.intel.com/
This is the V2, which only update the comments.

Patch 2 is to clean up the 023H enumeration.
To close the discussion at
https://lore.kernel.org/lkml/20250127212901.GB9557@noisy.programming.kicks-ass.net/

Patch 3 is to clean up the counter information update and check codes.
To close the discussion at
https://lore.kernel.org/lkml/20250127164406.GN16742@noisy.programming.kicks-ass.net/

Kan Liang (3):
  perf/x86/intel: Clean up PEBS-via-PT on hybrid
  perf/x86/intel: Fix ARCH_PERFMON_NUM_COUNTER_LEAF
  perf/x86/intel: Clean up counter information update and check

 arch/x86/events/core.c            |  10 +--
 arch/x86/events/intel/core.c      | 134 +++++++++++++++---------------
 arch/x86/events/intel/ds.c        |  10 ++-
 arch/x86/events/perf_event.h      |   1 +
 arch/x86/include/asm/perf_event.h |  28 ++++++-
 5 files changed, 106 insertions(+), 77 deletions(-)

-- 
2.38.1
Re: [PATCH 0/3] Cleanup for Intel PMU initialization
Posted by Peter Zijlstra 1 year ago
On Wed, Jan 29, 2025 at 07:48:17AM -0800, kan.liang@linux.intel.com wrote:
> From: Kan Liang <kan.liang@linux.intel.com>
> 
> The patches are to clean up different features. They all touch the
> initialization code. There are some dependencies. So I put them in
> a patch set to facilitate the review and merge.
> 
> Patch 1 is to clear up the PEBS-via-PT on hybrid.
> The original V1 patch can be found at
> https://lore.kernel.org/lkml/20250124183432.3565061-1-kan.liang@linux.intel.com/
> This is the V2, which only update the comments.
> 
> Patch 2 is to clean up the 023H enumeration.
> To close the discussion at
> https://lore.kernel.org/lkml/20250127212901.GB9557@noisy.programming.kicks-ass.net/
> 
> Patch 3 is to clean up the counter information update and check codes.
> To close the discussion at
> https://lore.kernel.org/lkml/20250127164406.GN16742@noisy.programming.kicks-ass.net/

So I can take 1 and 2, but 3 is part of that arch pebs things, and that
series is not in a shape I want to apply.

Also, I'm not at all sure 3 improves things, it might just make it
worse.
Re: [PATCH 0/3] Cleanup for Intel PMU initialization
Posted by Liang, Kan 1 year ago

On 2025-02-03 8:16 a.m., Peter Zijlstra wrote:
> On Wed, Jan 29, 2025 at 07:48:17AM -0800, kan.liang@linux.intel.com wrote:
>> From: Kan Liang <kan.liang@linux.intel.com>
>>
>> The patches are to clean up different features. They all touch the
>> initialization code. There are some dependencies. So I put them in
>> a patch set to facilitate the review and merge.
>>
>> Patch 1 is to clear up the PEBS-via-PT on hybrid.
>> The original V1 patch can be found at
>> https://lore.kernel.org/lkml/20250124183432.3565061-1-kan.liang@linux.intel.com/
>> This is the V2, which only update the comments.
>>
>> Patch 2 is to clean up the 023H enumeration.
>> To close the discussion at
>> https://lore.kernel.org/lkml/20250127212901.GB9557@noisy.programming.kicks-ass.net/
>>
>> Patch 3 is to clean up the counter information update and check codes.
>> To close the discussion at
>> https://lore.kernel.org/lkml/20250127164406.GN16742@noisy.programming.kicks-ass.net/
> 
> So I can take 1 and 2, 

Thanks.

> but 3 is part of that arch pebs things, and that
> series is not in a shape I want to apply.
> 
> Also, I'm not at all sure 3 improves things, it might just make it
> worse.

There should be some improvements for the initialization code. At least,
we can reduce the is_hybrid() check and move the 0x23 enumeration in one
place.

Anyway, I will think more and see if there is more that can be improved.
Then, put it as part of the arch pebs code. We may have further
discussions with the V2 arch PEBS code.

Thanks,
Kan