All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Senna Tschudin <peter.senna@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Peter Senna Tschudin <peter.senna@linux.intel.com>,
	Gustavo Sousa <gustavo.sousa@linux.intel.com>,
	Lucas de Marchi <lucas.demarchi@linux.intel.com>
Subject: [PATCH i-g-t 0/2] Add post-gpukmod-unbind igt_hook
Date: Thu,  3 Jul 2025 17:03:02 +0200	[thread overview]
Message-ID: <20250703150304.101208-1-peter.senna@linux.intel.com> (raw)

his patch introduces a new IGT hook: IGT_HOOK_POST_GPUKMOD_UNBIND
(post-gpukmod-unbind), designed to facilitate kmemleak scans in our CI
workflows.

As suggested by Lucas de Marchi, a useful strategy for detecting memory
leaks is to run kmemleak scans both before binding and after unbinding
the GPU kernel module. This patch adds support for the latter scenario,
enabling automated scans immediately after the GPU module is unbound.


Example test-list:
 igt@xe_module_load@load
 igt@core_hotunplug@unbind-rebind
 igt@xe_module_load@unload

Usage Example:
 IGT_PING_HOSTNAME='10.211.176.1'
 IGT_TEST_ROOT='/home/gta/UPSTREAM/igt-gpu-tools/build/tests/'
 ./build/runner/igt_runner -o -l verbose -s --per-test-timeout 120 \
   --overall-timeout 960 --piglit-style-dmesg --dmesg-warn-level=4 \
   --use-watchdog --inactivity-timeout 90 \
   --abort-on-monitored-error=ping,taint --disk-usage-limit=10M \
   --facts --hook 'post-gpukmod-unbind:OUTF=/tmp/kmemleak-post-unbind && \
                   echo $IGT_HOOK_TEST_FULLNAME $IGT_HOOK_TEST $IGT_HOOK_SUBTEST >> $OUTF && \
                   echo scan > /sys/kernel/debug/kmemleak && \
                   cat /sys/kernel/debug/kmemleak >> $OUTF' \
   --test-list ~/igt/test-list \
   /home/gta/igt/0

Known Limitations: In certain cases, such as when running
igt@core_hotunplug@unbind-rebind, the unbind operation is explicitly
managed by igt_runner if the module is already loaded. However, if the
unbind occurs outside of igt_runner, the hook will not be triggered and
the scan will not run.

Cc: Gustavo Sousa <gustavo.sousa@linux.intel.com>
Cc: Lucas de Marchi <lucas.demarchi@linux.intel.com>

Peter Senna Tschudin (2):
  igt_core: igt_hook_get_pointer() for external hooks
  lib/igt_kmod: Add IGT_HOOK_POST_GPUKMOD_UNBIND

 lib/igt_core.c | 12 ++++++++++++
 lib/igt_core.h |  9 +++++++++
 lib/igt_hook.c |  5 +++++
 lib/igt_hook.h |  1 +
 lib/igt_kmod.c |  7 +++++++
 5 files changed, 34 insertions(+)

-- 
2.43.0


             reply	other threads:[~2025-07-03 15:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-03 15:03 Peter Senna Tschudin [this message]
2025-07-03 15:03 ` [PATCH i-g-t 1/2] igt_core: igt_hook_get_pointer() for external hooks Peter Senna Tschudin
2025-07-03 19:25   ` Peter Senna Tschudin
2025-07-11 13:04   ` Gustavo Sousa
2025-07-03 15:03 ` [PATCH i-g-t 2/2] lib/igt_kmod: Add IGT_HOOK_POST_GPUKMOD_UNBIND Peter Senna Tschudin
2025-07-03 19:26   ` Peter Senna Tschudin
2025-07-11 13:20   ` Gustavo Sousa
2025-07-03 19:25 ` [PATCH i-g-t 0/2] Add post-gpukmod-unbind igt_hook Peter Senna Tschudin
2025-07-03 21:10 ` ✓ Xe.CI.BAT: success for " Patchwork
2025-07-03 21:12 ` ✓ i915.CI.BAT: " Patchwork
2025-07-04  3:41 ` ✗ i915.CI.Full: failure " Patchwork
2025-07-05 13:33 ` ✗ Xe.CI.Full: " Patchwork

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=20250703150304.101208-1-peter.senna@linux.intel.com \
    --to=peter.senna@linux.intel.com \
    --cc=gustavo.sousa@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=lucas.demarchi@linux.intel.com \
    /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 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.