linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] perf: Make SIGTRAP and __perf_pending_irq() work on RT.
@ 2024-03-12 18:01 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
                   ` (5 more replies)
  0 siblings, 6 replies; 26+ messages in thread
From: Sebastian Andrzej Siewior @ 2024-03-12 18:01 UTC (permalink / raw)
  To: linux-perf-users, linux-kernel
  Cc: Adrian Hunter, Alexander Shishkin, Arnaldo Carvalho de Melo,
	Ian Rogers, Ingo Molnar, Jiri Olsa, Marco Elver, Mark Rutland,
	Namhyung Kim, Peter Zijlstra, Thomas Gleixner

Hi,

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.

Sebastian


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

end of thread, other threads:[~2024-03-15  7:41 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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