linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH 0/4] perf: Fix leaked events when sigtrap = 1
       [not found]   ` <ZhRI7WfjgkCTK9aK@pavilion.home>
@ 2024-04-08 20:20     ` Arnaldo Carvalho de Melo
  2024-04-08 20:58       ` Frederic Weisbecker
  0 siblings, 1 reply; 2+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-04-08 20:20 UTC (permalink / raw)
  To: Frederic Weisbecker, Sebastian Andrzej Siewior
  Cc: Ian Rogers, LKML, Peter Zijlstra, Ingo Molnar, Namhyung Kim,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Adrian Hunter,
	Thomas Gleixner, linux-perf-users

On Mon, Apr 08, 2024 at 09:43:41PM +0200, Frederic Weisbecker wrote:
> Le Fri, Mar 29, 2024 at 08:23:49PM -0700, Ian Rogers a écrit :
> > On Fri, Mar 29, 2024 at 4:58 PM Frederic Weisbecker <frederic@kernel.org> wrote:
> > >
> > > While looking at task_work users I just noticed that perf doesn't flush
> > > its own upon event exiting. This looks especially problematic with child
> > > events. Please have a thourough look at the last patch, I may easily
> > > have missed something within the maze.
> > >
> > > Frederic Weisbecker (4):
> > >   task_work: s/task_work_cancel()/task_work_cancel_func()/
> > >   task_work: Introduce task_work_cancel() again
> > >   perf: Fix event leak upon exit
> > >   perf: Fix event leak upon exec and file release
> > >
> > >  include/linux/perf_event.h |  1 +
> > >  include/linux/task_work.h  |  3 ++-
> > >  kernel/events/core.c       | 40 +++++++++++++++++++++++++++++++-------
> > >  kernel/irq/manage.c        |  2 +-
> > >  kernel/task_work.c         | 34 +++++++++++++++++++++++++++-----
> > >  security/keys/keyctl.c     |  2 +-
> > >  6 files changed, 67 insertions(+), 15 deletions(-)
> > 
> > Thanks for this! I wonder if this relates to fuzzing failures like:
> > https://lore.kernel.org/linux-perf-users/CAP-5=fUa+-Tj2b_hxk96Qg5=Qu7jYHgHREbsmBa2ZmuF-X9QaA@mail.gmail.com/
> > "[ 2519.138665] unexpected event refcount: 2; ptr=000000009c56b097"
> 
> Probably not since those seem to happen on perf_event_open() failures. This
> looks different.

Probably clashes with this one?

"[PATCH v3 0/4] perf: Make SIGTRAP and __perf_pending_irq() work on RT."

https://lore.kernel.org/all/20240322065208.60456-1-bigeasy@linutronix.de/T/#u

- Arnaldo

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 0/4] perf: Fix leaked events when sigtrap = 1
  2024-04-08 20:20     ` [PATCH 0/4] perf: Fix leaked events when sigtrap = 1 Arnaldo Carvalho de Melo
@ 2024-04-08 20:58       ` Frederic Weisbecker
  0 siblings, 0 replies; 2+ messages in thread
From: Frederic Weisbecker @ 2024-04-08 20:58 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Sebastian Andrzej Siewior, Ian Rogers, LKML, Peter Zijlstra,
	Ingo Molnar, Namhyung Kim, Mark Rutland, Alexander Shishkin,
	Jiri Olsa, Adrian Hunter, Thomas Gleixner, linux-perf-users

Le Mon, Apr 08, 2024 at 05:20:27PM -0300, Arnaldo Carvalho de Melo a écrit :
> On Mon, Apr 08, 2024 at 09:43:41PM +0200, Frederic Weisbecker wrote:
> > Le Fri, Mar 29, 2024 at 08:23:49PM -0700, Ian Rogers a écrit :
> > > On Fri, Mar 29, 2024 at 4:58 PM Frederic Weisbecker <frederic@kernel.org> wrote:
> > > >
> > > > While looking at task_work users I just noticed that perf doesn't flush
> > > > its own upon event exiting. This looks especially problematic with child
> > > > events. Please have a thourough look at the last patch, I may easily
> > > > have missed something within the maze.
> > > >
> > > > Frederic Weisbecker (4):
> > > >   task_work: s/task_work_cancel()/task_work_cancel_func()/
> > > >   task_work: Introduce task_work_cancel() again
> > > >   perf: Fix event leak upon exit
> > > >   perf: Fix event leak upon exec and file release
> > > >
> > > >  include/linux/perf_event.h |  1 +
> > > >  include/linux/task_work.h  |  3 ++-
> > > >  kernel/events/core.c       | 40 +++++++++++++++++++++++++++++++-------
> > > >  kernel/irq/manage.c        |  2 +-
> > > >  kernel/task_work.c         | 34 +++++++++++++++++++++++++++-----
> > > >  security/keys/keyctl.c     |  2 +-
> > > >  6 files changed, 67 insertions(+), 15 deletions(-)
> > > 
> > > Thanks for this! I wonder if this relates to fuzzing failures like:
> > > https://lore.kernel.org/linux-perf-users/CAP-5=fUa+-Tj2b_hxk96Qg5=Qu7jYHgHREbsmBa2ZmuF-X9QaA@mail.gmail.com/
> > > "[ 2519.138665] unexpected event refcount: 2; ptr=000000009c56b097"
> > 
> > Probably not since those seem to happen on perf_event_open() failures. This
> > looks different.
> 
> Probably clashes with this one?
> 
> "[PATCH v3 0/4] perf: Make SIGTRAP and __perf_pending_irq() work on RT."
> 
> https://lore.kernel.org/all/20240322065208.60456-1-bigeasy@linutronix.de/T/#u

Nice, I think it partially fixes the issues I've seen. Lemme review that.

Thanks.

> 
> - Arnaldo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-04-08 20:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20240329235812.18917-1-frederic@kernel.org>
     [not found] ` <CAP-5=fVwT1FPTps=i=hG2O0sWr9DH92VSt66Co=Rhf9dyZX7ag@mail.gmail.com>
     [not found]   ` <ZhRI7WfjgkCTK9aK@pavilion.home>
2024-04-08 20:20     ` [PATCH 0/4] perf: Fix leaked events when sigtrap = 1 Arnaldo Carvalho de Melo
2024-04-08 20:58       ` Frederic Weisbecker

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).