lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aCz8AMGRfIOxo9AN@google.com>
Date: Tue, 20 May 2025 15:02:40 -0700
From: Namhyung Kim <namhyung@...nel.org>
To: kan.liang@...ux.intel.com
Cc: peterz@...radead.org, mingo@...hat.com, irogers@...gle.com,
	mark.rutland@....com, linux-kernel@...r.kernel.org,
	linux-perf-users@...r.kernel.org, eranian@...gle.com,
	ctshao@...gle.com, tmricht@...ux.ibm.com, leo.yan@....com
Subject: Re: [PATCH V4 02/16] perf: Only dump the throttle log for the leader

On Tue, May 20, 2025 at 11:16:30AM -0700, kan.liang@...ux.intel.com wrote:
> From: Kan Liang <kan.liang@...ux.intel.com>
> 
> The PERF_RECORD_THROTTLE records are dumped for all throttled events.
> It's not necessary for group events, which are throttled altogether.
> 
> Optimize it by only dump the throttle log for the leader.
> 
> The sample right after the THROTTLE record must be generated by the
> actual target event. It is good enough for the perf tool to locate the
> actual target event.
> 
> Suggested-by: Namhyung Kim <namhyung@...nel.org>
> Signed-off-by: Kan Liang <kan.liang@...ux.intel.com>

Acked-by: Namhyung Kim <namhyung@...nel.org>

Thanks,
Namhyung

> ---
>  kernel/events/core.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/events/core.c b/kernel/events/core.c
> index 915698f47682..cd559501cfbd 100644
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -2744,14 +2744,16 @@ static void perf_event_unthrottle(struct perf_event *event, bool start)
>  	event->hw.interrupts = 0;
>  	if (start)
>  		event->pmu->start(event, 0);
> -	perf_log_throttle(event, 1);
> +	if (event == event->group_leader)
> +		perf_log_throttle(event, 1);
>  }
>  
>  static void perf_event_throttle(struct perf_event *event)
>  {
>  	event->pmu->stop(event, 0);
>  	event->hw.interrupts = MAX_INTERRUPTS;
> -	perf_log_throttle(event, 0);
> +	if (event == event->group_leader)
> +		perf_log_throttle(event, 0);
>  }
>  
>  static void perf_event_unthrottle_group(struct perf_event *event, bool skip_start_event)
> -- 
> 2.38.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ