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] [day] [month] [year] [list]
Message-ID: <20251118112406.GH4067720@noisy.programming.kicks-ass.net>
Date: Tue, 18 Nov 2025 12:24:06 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: "Mi, Dapeng" <dapeng1.mi@...ux.intel.com>
Cc: Ingo Molnar <mingo@...hat.com>,
	Arnaldo Carvalho de Melo <acme@...nel.org>,
	Namhyung Kim <namhyung@...nel.org>, Ian Rogers <irogers@...gle.com>,
	Adrian Hunter <adrian.hunter@...el.com>,
	Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
	Andi Kleen <ak@...ux.intel.com>,
	Eranian Stephane <eranian@...gle.com>, linux-kernel@...r.kernel.org,
	linux-perf-users@...r.kernel.org, Dapeng Mi <dapeng1.mi@...el.com>,
	Zide Chen <zide.chen@...el.com>,
	Falcon Thomas <thomas.falcon@...el.com>,
	Xudong Hao <xudong.hao@...el.com>
Subject: Re: [PATCH] perf: Fix 0 count issue of cpu-clock

On Tue, Nov 18, 2025 at 07:22:24PM +0800, Mi, Dapeng wrote:
> 
> On 11/18/2025 7:04 PM, Peter Zijlstra wrote:
> > On Tue, Nov 18, 2025 at 12:03:09PM +0100, Peter Zijlstra wrote:
> >> On Wed, Nov 12, 2025 at 04:05:26PM +0800, Dapeng Mi wrote:
> >>
> >>> diff --git a/kernel/events/core.c b/kernel/events/core.c
> >>> index f6a08c73f783..77d3af5959c1 100644
> >>> --- a/kernel/events/core.c
> >>> +++ b/kernel/events/core.c
> >>> @@ -11964,7 +11964,7 @@ static int cpu_clock_event_add(struct perf_event *event, int flags)
> >>>  
> >>>  static void cpu_clock_event_del(struct perf_event *event, int flags)
> >>>  {
> >>> -	cpu_clock_event_stop(event, flags);
> >>> +	cpu_clock_event_stop(event, flags | PERF_EF_UPDATE);
> >>>  }
> >>>  
> >>>  static void cpu_clock_event_read(struct perf_event *event)
> >>> @@ -12043,7 +12043,7 @@ static int task_clock_event_add(struct perf_event *event, int flags)
> >>>  
> >>>  static void task_clock_event_del(struct perf_event *event, int flags)
> >>>  {
> >>> -	task_clock_event_stop(event, PERF_EF_UPDATE);
> >>> +	task_clock_event_stop(event, flags | PERF_EF_UPDATE);
> >>>  }
> >> I think it can both just be: PERF_EF_UPDATE. The only pmu::del() caller
> >> hands in flags=0, but if there were to be flags added, we'd have to
> >> audit all del methods anyway.
> >>
> >> Also, the few comments we do have already note that ->del() must do
> >> ->stop(EF_UPDATE).
> > Updated patch now sits in queue/perf/urgent.
> 
> Hi Peter,
> 
> Thanks for merging. If we decide not to or the "flags", then the last
> sentence "Besides, or flags with PERF_EF_UPDATE for task-clock although
> currently the flags argument would always be 0." in the commit message
> should be dropped as well. :)

Should be fixed now. Thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ