linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Liang, Kan" <kan.liang@linux.intel.com>
To: Ingo Molnar <mingo@kernel.org>
Cc: peterz@infradead.org, mingo@redhat.com, namhyung@kernel.org,
	irogers@google.com, mark.rutland@arm.com,
	linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	eranian@google.com, ctshao@google.com, tmricht@linux.ibm.com,
	leo.yan@arm.com
Subject: Re: [PATCH V3 02/16] perf: Fix the throttle logic for a group
Date: Tue, 20 May 2025 10:16:21 -0400	[thread overview]
Message-ID: <1e380367-aaad-4c02-bc10-b85b25dd2274@linux.intel.com> (raw)
In-Reply-To: <aChHXShBhoDBgPX7@gmail.com>



On 2025-05-17 4:22 a.m., Ingo Molnar wrote:
> 
> * kan.liang@linux.intel.com <kan.liang@linux.intel.com> wrote:
> 
>> The throttle only happens when an event is overflowed. Stop the entire
>> group when any event in the group triggers the throttle.
>> The MAX_INTERRUPTS is set to all throttle events.
> 
> Since this is a relatively long series with a healthy dose of 
> breakage-risk, I'm wondering about bisectability:
> 
>  - patch #2 auto-throttles groups, ie. stops the PMU
> 
>  - patches #3-#16 removes explicit PMU-stop calls.
> 
> In the interim commits, will the double PMU-stop in drivers not updated 
> yet do anything noticeable, such as generate warnings, etc?
> 

The short answer is no.

Here are the details for different ARCHs.

There is a active_mask to track the active counter/event in X86. The
current implementation checks the corresponding bit first. If it is
already cleared, do nothing. It avoids the double PMU-stop. I've tested
on my machine.
AMD and Zhaoxin shares the same x86_pmu_stop() as Intel. They are OK as
well.

powerpc, S390, ARC, sparc and xtensa utilize the PERF_HES_STOPPED flag
instead. If the flag has been set, do nothing. It can also avoids the
double PMU-stop.

ARM, apple m1, csky, loongarch and mips invoke the disable_event, rather
than PMU stop. The disable_event unconditionally disables the counter
register. It doesn't check if the register is already disabled. But I
don't think double writing a register can trigger any issue.

Alpha utilizes the PERF_HES_STOPPED flag. But it seems still writes the
counter register even it's already disabled. Because the cpuc->enabled
is used to check whether to write to the register. It's not updated in
the alpha_pmu_stop(). But again, I don't think double writing a register
can trigger any issue.

Thanks,
Kan


  reply	other threads:[~2025-05-20 14:16 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-16 18:28 [PATCH V3 00/16] perf: Fix the throttle logic for group kan.liang
2025-05-16 18:28 ` [PATCH V3 01/16] perf: Clean up event in freq mode check kan.liang
2025-05-16 18:28 ` [PATCH V3 02/16] perf: Fix the throttle logic for a group kan.liang
2025-05-17  8:22   ` Ingo Molnar
2025-05-20 14:16     ` Liang, Kan [this message]
2025-05-18 19:18   ` Namhyung Kim
2025-05-20 14:47     ` Liang, Kan
2025-05-20 20:02       ` Namhyung Kim
2025-05-16 18:28 ` [PATCH V3 03/16] perf/x86/intel: Remove driver-specific throttle support kan.liang
2025-05-16 18:28 ` [PATCH V3 04/16] perf/x86/amd: " kan.liang
2025-05-16 18:28 ` [PATCH V3 05/16] perf/x86/zhaoxin: " kan.liang
2025-05-16 18:28 ` [PATCH V3 06/16] powerpc/perf: " kan.liang
2025-05-16 18:28 ` [PATCH V3 07/16] s390/perf: " kan.liang
2025-05-16 18:28 ` [PATCH V3 08/16] perf/arm: " kan.liang
2025-05-16 18:28 ` [PATCH V3 09/16] perf/apple_m1: " kan.liang
2025-05-16 18:28 ` [PATCH V3 10/16] alpha/perf: " kan.liang
2025-05-16 18:28 ` [PATCH V3 11/16] arc/perf: " kan.liang
2025-05-18 21:58   ` Vineet Gupta
2025-05-16 18:28 ` [PATCH V3 12/16] csky/perf: " kan.liang
2025-05-16 18:28 ` [PATCH V3 13/16] loongarch/perf: " kan.liang
2025-05-16 18:28 ` [PATCH V3 14/16] sparc/perf: " kan.liang
2025-05-16 18:28 ` [PATCH V3 15/16] xtensa/perf: " kan.liang
2025-05-16 18:28 ` [PATCH V3 16/16] mips/perf: " 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=1e380367-aaad-4c02-bc10-b85b25dd2274@linux.intel.com \
    --to=kan.liang@linux.intel.com \
    --cc=ctshao@google.com \
    --cc=eranian@google.com \
    --cc=irogers@google.com \
    --cc=leo.yan@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tmricht@linux.ibm.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;
as well as URLs for NNTP newsgroup(s).