linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Marco Elver <elver@google.com>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	Adrian Hunter <adrian.hunter@intel.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Ian Rogers <irogers@google.com>, Ingo Molnar <mingo@redhat.com>,
	Jiri Olsa <jolsa@kernel.org>, Mark Rutland <mark.rutland@arm.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH v2 0/4] perf: Make SIGTRAP and __perf_pending_irq() work on RT.
Date: Wed, 13 Mar 2024 15:14:28 -0300	[thread overview]
Message-ID: <ZfHtBB5_-3RByE8p@x1> (raw)
In-Reply-To: <ZfHE9Ev5T3Lq7o34@x1>

On Wed, Mar 13, 2024 at 12:23:32PM -0300, Arnaldo Carvalho de Melo wrote:
> On Wed, Mar 13, 2024 at 03:35:27PM +0100, Marco Elver wrote:
> > On Tue, 12 Mar 2024 at 19:08, Sebastian Andrzej Siewior <bigeasy@linutronix.de> wrote:
> > > Arnaldo reported that "perf test sigtrap" fails on PREEMPT_RT. Sending
> > > the signal gets delayed until event_sched_out() which then uses
> > > task_work_add() for its delivery. This breaks on PREEMPT_RT because the
> > > signal is delivered with disabled preemption.
 
> > > While looking at this, I also stumbled upon __perf_pending_irq() which
> > > requires disabled interrupts but this is not the case on PREEMPT_RT.
 
> > > This series aim to address both issues while not introducing a new issue
> > > at the same time ;)
> > > Any testing is appreciated.
 
> > > v1…v2: https://lore.kernel.org/all/20240308175810.2894694-1-bigeasy@linutronix.de/
> > >     - Marco pointed me to the testsuite that showed two problems:
> > >       - Delayed task_work from NMI / missing events.
> > >         Fixed by triggering dummy irq_work to enforce an interrupt for
> > >         the exit-to-userland path which checks task_work
> > >       - Increased ref-count on clean up/ during exec.
> > >         Mostly addressed by the former change. There is still a window
> > >         if the NMI occurs during execve(). This is addressed by removing
> > >         the task_work before free_event().
> > >       The testsuite (remove_on_exec) fails sometimes if the event/
> > >       SIGTRAP is sent before the sighandler is installed.
>  
> > Tested-by: Marco Elver <elver@google.com>
>  
> > It does pass the tests in tools/testing/selftests/perf_events (non-RT
> > kernel, lockdep enabled). But I do recall this being a particularly
> > sharp corner of perf, so any additional testing and review here is
> > useful.

> Right, I'm testing with the full 'perf test' suite now.

'perf test' doesn't show any regression, now I'm running Vince Weaver's
https://github.com/deater/perf_event_tests, storing the results with
this patchset and then without, to do a diff, lets see...

- Arnaldo

  reply	other threads:[~2024-03-13 18:14 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-12 18:01 [PATCH v2 0/4] perf: Make SIGTRAP and __perf_pending_irq() work on RT Sebastian Andrzej Siewior
2024-03-12 18:01 ` [PATCH v2 1/4] perf: Move irq_work_queue() where the event is prepared Sebastian Andrzej Siewior
2024-03-12 18:01 ` [PATCH v2 2/4] perf: Enqueue SIGTRAP always via task_work Sebastian Andrzej Siewior
2024-03-13 14:41   ` Marco Elver
2024-03-14  9:35     ` Sebastian Andrzej Siewior
2024-03-12 18:01 ` [PATCH v2 3/4] perf: Remove perf_swevent_get_recursion_context() from perf_pending_task() Sebastian Andrzej Siewior
2024-03-12 18:01 ` [PATCH v2 4/4] perf: Split __perf_pending_irq() out of perf_pending_irq() Sebastian Andrzej Siewior
2024-03-12 21:42 ` [PATCH v2 0/4] perf: Make SIGTRAP and __perf_pending_irq() work on RT Arnaldo Carvalho de Melo
2024-03-13  8:13   ` Sebastian Andrzej Siewior
2024-03-13 13:28     ` Arnaldo Carvalho de Melo
2024-03-13 13:46       ` Sebastian Andrzej Siewior
2024-03-13 14:06         ` Arnaldo Carvalho de Melo
2024-03-13 13:47       ` Arnaldo Carvalho de Melo
2024-03-13 14:15         ` Sebastian Andrzej Siewior
2024-03-13 14:17         ` Marco Elver
2024-03-13 14:35 ` Marco Elver
2024-03-13 15:23   ` Arnaldo Carvalho de Melo
2024-03-13 18:14     ` Arnaldo Carvalho de Melo [this message]
2024-03-13 18:30       ` Arnaldo Carvalho de Melo
2024-03-13 20:12         ` Arnaldo Carvalho de Melo
2024-03-13 20:14           ` Arnaldo Carvalho de Melo
2024-03-14  9:10             ` Sebastian Andrzej Siewior
2024-03-14 14:34               ` Arnaldo Carvalho de Melo
2024-03-14 21:22                 ` Arnaldo Carvalho de Melo
2024-03-14 21:46                   ` Arnaldo Carvalho de Melo
2024-03-15  7:41                     ` Sebastian Andrzej Siewior

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=ZfHtBB5_-3RByE8p@x1 \
    --to=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=bigeasy@linutronix.de \
    --cc=elver@google.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /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).