All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 i-g-t 0/6] Fix xe_eudebug_online@set-breakpoint-sigint-debugger
@ 2025-09-23 13:09 Dominik Karol Piątkowski
  2025-09-23 13:09 ` [PATCH v4 i-g-t 1/6] lib/xe_eudebug: Fix safe_pipe_read Dominik Karol Piątkowski
                   ` (9 more replies)
  0 siblings, 10 replies; 24+ messages in thread
From: Dominik Karol Piątkowski @ 2025-09-23 13:09 UTC (permalink / raw)
  To: igt-dev
  Cc: Zbigniew Kempczyński, Mika Kuoppala,
	Dominik Karol Piątkowski

The thought behind xe_eudebug_online@set-breakpoint-sigint-debugger test
is to check if SIGINT during EUdebug ioctls will not break the kernel.
It is done by looping set-breakpoint test equivalent for a minute while
sending SIGINT to debugger thread with random timing, hoping to hit the
ioctl given enough repetitions.

Sporadically, the test deadlocks - it is caused by random timing of
pthread_exit calls that can land in a critical section, leaving held
resources; next entry attempt into that critical section will cause
deadlock.

Rewrite SIGINT signal handler to toggle a variable instead of calling
pthread_exit instantly and exit in main debugger loop if said variable
is set. To utilize the new SIGINT handler, use pthread_sigqueue instead
of pthread_kill in order to be able to pass debugger to signal handler.
Put the pthread_sigqueue call into library function helper. Rename
terminate_debugger to debugger_signal_handler to describe its new
function better. Add SIGTERM to signals that are handled by
debugger_signal_handler. Don't kill debugger thread on non-SIGINT
signals.

Harden xe_eudebug library code and xe_eudebug_online test code in the
set-breakpoint-sigint-debugger path that can produce unwanted igt_assert
fails due to unfortunate timing. Issue some SIGTERM signals in quick
succession before SIGINT to raise the odds of hitting the ioctl.

Signed-off-by: Dominik Karol Piątkowski <dominik.karol.piatkowski@intel.com>

Dominik Karol Piątkowski (6):
  lib/xe_eudebug: Fix safe_pipe_read
  lib/xe_eudebug: Don't fail in __wait_token if pipe was broken
  tests/xe_eudebug_online: Allow dead client in
    set-breakpoint-sigint-debugger
  lib/xe_eudebug: Improve SIGINT handling
  lib/xe_eudebug: Introduce xe_eudebug_debugger_kill
  tests/xe_eudebug_online: Improve issuing SIGINT in
    set-breakpoint-sigint-debugger

 lib/xe/xe_eudebug.c             | 66 ++++++++++++++++++++++++++++++---
 lib/xe/xe_eudebug.h             |  7 ++++
 tests/intel/xe_eudebug_online.c | 10 ++++-
 3 files changed, 76 insertions(+), 7 deletions(-)

-- 
2.34.1


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

end of thread, other threads:[~2025-09-25  7:08 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-23 13:09 [PATCH v4 i-g-t 0/6] Fix xe_eudebug_online@set-breakpoint-sigint-debugger Dominik Karol Piątkowski
2025-09-23 13:09 ` [PATCH v4 i-g-t 1/6] lib/xe_eudebug: Fix safe_pipe_read Dominik Karol Piątkowski
2025-09-23 14:43   ` Manszewski, Christoph
2025-09-23 13:09 ` [PATCH v4 i-g-t 2/6] lib/xe_eudebug: Don't fail in __wait_token if pipe was broken Dominik Karol Piątkowski
2025-09-23 15:00   ` Manszewski, Christoph
2025-09-23 13:09 ` [PATCH v4 i-g-t 3/6] tests/xe_eudebug_online: Allow dead client in set-breakpoint-sigint-debugger Dominik Karol Piątkowski
2025-09-23 15:02   ` Manszewski, Christoph
2025-09-23 13:10 ` [PATCH v4 i-g-t 4/6] lib/xe_eudebug: Improve SIGINT handling Dominik Karol Piątkowski
2025-09-24  6:29   ` Zbigniew Kempczyński
2025-09-24 12:38     ` Piatkowski, Dominik Karol
2025-09-24 11:42   ` Manszewski, Christoph
2025-09-24 12:38     ` Piatkowski, Dominik Karol
2025-09-24 13:57       ` Manszewski, Christoph
2025-09-25  7:08         ` Piatkowski, Dominik Karol
2025-09-23 13:10 ` [PATCH v4 i-g-t 5/6] lib/xe_eudebug: Introduce xe_eudebug_debugger_kill Dominik Karol Piątkowski
2025-09-24  6:37   ` Zbigniew Kempczyński
2025-09-23 13:10 ` [PATCH v4 i-g-t 6/6] tests/xe_eudebug_online: Improve issuing SIGINT in set-breakpoint-sigint-debugger Dominik Karol Piątkowski
2025-09-24  6:40   ` Zbigniew Kempczyński
2025-09-24 11:48     ` Manszewski, Christoph
2025-09-24 12:39       ` Piatkowski, Dominik Karol
2025-09-24  0:45 ` ✓ Xe.CI.BAT: success for Fix xe_eudebug_online@set-breakpoint-sigint-debugger (rev4) Patchwork
2025-09-24  0:55 ` ✓ i915.CI.BAT: " Patchwork
2025-09-24  4:57 ` ✓ Xe.CI.Full: " Patchwork
2025-09-24 15:31 ` ✓ i915.CI.Full: " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.