All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v7 i-g-t 0/9] Fix xe_eudebug_online@set-breakpoint-sigint-debugger
@ 2025-09-26  7:47 Dominik Karol Piątkowski
  2025-09-26  7:47 ` [PATCH v7 i-g-t 1/9] lib/xe_eudebug: Fix safe_pipe_read Dominik Karol Piątkowski
                   ` (12 more replies)
  0 siblings, 13 replies; 21+ messages in thread
From: Dominik Karol Piątkowski @ 2025-09-26  7:47 UTC (permalink / raw)
  To: igt-dev
  Cc: Zbigniew Kempczyński, Mika Kuoppala, Christoph Manszewski,
	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 SIGTERM signal.

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 (9):
  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: Introduce xe_eudebug_debugger_kill
  tests/xe_eudebug_online: Improve issuing SIGINT in
    set-breakpoint-sigint-debugger
  lib/xe_eudebug: Improve SIGINT handling
  tests/xe_eudebug_online: Introduce proper sync for closing debugger fd
    in set-breakpoint-sigint-debugger
  lib/xe_eudebug: Introduce SIGTERM handling
  tests/xe_eudebug_online: Issue SIGTERM in
    set-breakpoint-sigint-debugger

 lib/xe/xe_eudebug.c             | 87 ++++++++++++++++++++++++++++-----
 lib/xe/xe_eudebug.h             |  7 +++
 tests/intel/xe_eudebug_online.c | 16 +++++-
 3 files changed, 98 insertions(+), 12 deletions(-)

-- 
2.34.1


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

end of thread, other threads:[~2025-09-29 19:20 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-26  7:47 [PATCH v7 i-g-t 0/9] Fix xe_eudebug_online@set-breakpoint-sigint-debugger Dominik Karol Piątkowski
2025-09-26  7:47 ` [PATCH v7 i-g-t 1/9] lib/xe_eudebug: Fix safe_pipe_read Dominik Karol Piątkowski
2025-09-29 19:11   ` Zbigniew Kempczyński
2025-09-26  7:47 ` [PATCH v7 i-g-t 2/9] lib/xe_eudebug: Don't fail in __wait_token if pipe was broken Dominik Karol Piątkowski
2025-09-29 11:29   ` Manszewski, Christoph
2025-09-26  7:47 ` [PATCH v7 i-g-t 3/9] tests/xe_eudebug_online: Allow dead client in set-breakpoint-sigint-debugger Dominik Karol Piątkowski
2025-09-26  7:47 ` [PATCH v7 i-g-t 4/9] lib/xe_eudebug: Introduce xe_eudebug_debugger_kill Dominik Karol Piątkowski
2025-09-26  7:47 ` [PATCH v7 i-g-t 5/9] tests/xe_eudebug_online: Improve issuing SIGINT in set-breakpoint-sigint-debugger Dominik Karol Piątkowski
2025-09-29 19:13   ` Zbigniew Kempczyński
2025-09-26  7:47 ` [PATCH v7 i-g-t 6/9] lib/xe_eudebug: Improve SIGINT handling Dominik Karol Piątkowski
2025-09-29 19:16   ` Zbigniew Kempczyński
2025-09-26  7:47 ` [PATCH v7 i-g-t 7/9] tests/xe_eudebug_online: Introduce proper sync for closing debugger fd in set-breakpoint-sigint-debugger Dominik Karol Piątkowski
2025-09-29 19:17   ` Zbigniew Kempczyński
2025-09-26  7:48 ` [PATCH v7 i-g-t 8/9] lib/xe_eudebug: Introduce SIGTERM handling Dominik Karol Piątkowski
2025-09-29 19:19   ` Zbigniew Kempczyński
2025-09-26  7:48 ` [PATCH v7 i-g-t 9/9] tests/xe_eudebug_online: Issue SIGTERM in set-breakpoint-sigint-debugger Dominik Karol Piątkowski
2025-09-29 19:20   ` Zbigniew Kempczyński
2025-09-26 18:10 ` ✓ Xe.CI.BAT: success for Fix xe_eudebug_online@set-breakpoint-sigint-debugger (rev7) Patchwork
2025-09-26 18:26 ` ✓ i915.CI.BAT: " Patchwork
2025-09-26 23:21 ` ✗ i915.CI.Full: failure " Patchwork
2025-09-27  0:38 ` ✗ Xe.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.