All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Mika Kuoppala" <mika.kuoppala@linux.intel.com>,
	intel-xe@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 08/20] drm/xe/eudebug: Introduce exec_queue events
Date: Mon, 09 Nov 2026 14:16:39 +0000	[thread overview]
Message-ID: <sashiko-outbox-205074@kernel.org> (raw)
In-Reply-To: <20261109135549.4128280-9-mika.kuoppala@linux.intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] drm/xe/eudebug: discover_client() counts non-debuggable queues
  in eq_count
--

commit 926a26106604e590716ee8ab1001dab4ed5f0566
Author: Dominik Grzegorzek <dominik.grzegorzek@intel.com>

drm/xe/eudebug: Introduce exec_queue events

This commit adds eudebug resource creation and destruction events for
debuggable render and compute exec queues, both during live ioctls and
when discovering an existing client's resources.

> diff --git a/drivers/gpu/drm/xe/xe_eudebug.c b/drivers/gpu/drm/xe/xe_eudebug.c
> index e0ef34588d3d4..0f8b0452f9bae 100644
> --- a/drivers/gpu/drm/xe/xe_eudebug.c
> +++ b/drivers/gpu/drm/xe/xe_eudebug.c
[ ... ]
> +void xe_eudebug_exec_queue_create(struct xe_file *xef, struct xe_exec_queue *q)
> +{
> +	struct xe_eudebug *d;
> +	int err;
> +
> +	if (!xe_engine_supports_eudebug(q->class))
> +		return;
> +
> +	d = xe_eudebug_get(xef);
> +	if (!d)
> +		return;
> +
> +	err = exec_queue_create_event(d, xef, q);
> +	if (err)
> +		xe_eudebug_disconnect(d, err);
> +
> +	xe_eudebug_put(d);
> +}
> +
> +void xe_eudebug_exec_queue_destroy(struct xe_file *xef, struct xe_exec_queue *q)
> +{
> +	struct xe_eudebug *d;
> +	int err;
> +
> +	if (!xe_engine_supports_eudebug(q->class))
> +		return;
> +
> +	d = xe_eudebug_get(xef);
> +	if (!d)
> +		return;
> +
> +	err = exec_queue_destroy_event(d, xef, q);
> +	if (err)
> +		xe_eudebug_disconnect(d, err);
> +
> +	xe_eudebug_put(d);
> +}
> +
>  /*
>   * All the relevant ioctls that manipulate the xe_file resources eudebug
>   * cares about are gated behind down_read(&xef->eudebug.ioctl_lock). The
> @@ -807,9 +1069,10 @@ void xe_eudebug_vm_destroy(struct xe_file *xef, struct xe_vm *vm)
>   */
>  static int discover_client(struct xe_eudebug *d, struct xe_file *xef)
>  {
> +	struct xe_exec_queue *q;
>  	struct xe_vm *vm;
>  	unsigned long i;
> -	unsigned int vm_count = 0;
> +	unsigned int vm_count = 0, eq_count = 0;
>  	int err = 0;
>  
>  	lockdep_assert_held_write(&xef->eudebug.ioctl_lock);
> @@ -828,10 +1091,21 @@ static int discover_client(struct xe_eudebug *d, struct xe_file *xef)
>  		vm_count++;
>  	}
>  
> +	xa_for_each(&xef->exec_queue.xa, i, q) {
> +		if (!xe_engine_supports_eudebug(q->class))
> +			continue;
> +
> +		err = exec_queue_create_event(d, xef, q);
> +		if (err)
> +			goto out;
> +
> +		eq_count++;
> +	}
> +
>  out:
> -	if (vm_count)
> -		eu_dbg(d, "Discovery found %u vms",
> -		       vm_count);
> +	if (vm_count || eq_count)
> +		eu_dbg(d, "Discovery found %u vms, %u exec_queues",
> +		       vm_count, eq_count);

[Severity: Low]
Does discover_client() count non-debuggable render and compute queues in
eq_count?

exec_queue_create_event() returns 0 without emitting an event when
!xe_exec_queue_is_debuggable(q), so any render or compute queue created
without DRM_XE_EXEC_QUEUE_SET_PROPERTY_EUDEBUG still increments eq_count.
Checking xe_exec_queue_is_debuggable(q) in discover_client(), as well as
at the top of xe_eudebug_exec_queue_create() and
xe_eudebug_exec_queue_destroy(), would also avoid taking and dropping the
debugger reference for non-debuggable queues.  Finally, the kernel-doc for
struct drm_xe_eudebug_event_exec_queue in include/uapi/drm/xe_drm_eudebug.h
could mention that only queues with DRM_XE_EXEC_QUEUE_SET_PROPERTY_EUDEBUG
are reported, matching struct drm_xe_eudebug_event_vm.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261109135549.4128280-1-mika.kuoppala@linux.intel.com?part=8

  reply	other threads:[~2026-11-09 14:16 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-09 13:55 [PATCH 00/20] Intel Xe GPU Debug Support (eudebug) v11 Mika Kuoppala
2026-11-09 13:55 ` [PATCH 01/20] drm/ttm: Add ttm_bo_access_locked() Mika Kuoppala
2026-11-09 13:55 ` [PATCH 02/20] drm/xe/eudebug: Introduce eudebug interface Mika Kuoppala
2026-11-09 13:55 ` [PATCH 03/20] drm/xe/eudebug: Add documentation Mika Kuoppala
2026-11-09 13:55 ` [PATCH 04/20] drm/xe/eudebug: Add connection establishment documentation Mika Kuoppala
2026-11-09 13:55 ` [PATCH 05/20] drm/xe: Implement SR-IOV and eudebug exclusivity Mika Kuoppala
2026-11-09 13:55 ` [PATCH 06/20] drm/xe/eudebug: Introduce discovery for resources Mika Kuoppala
2026-11-09 13:55 ` [PATCH 07/20] drm/xe: Add EUDEBUG_ENABLE exec queue property Mika Kuoppala
2026-11-09 13:55 ` [PATCH 08/20] drm/xe/eudebug: Introduce exec_queue events Mika Kuoppala
2026-11-09 14:16   ` sashiko-bot [this message]
2026-11-09 13:55 ` [PATCH 09/20] drm/xe/eudebug: Mark guc contexts as debuggable Mika Kuoppala
2026-11-09 13:55 ` [PATCH 10/20] drm/xe: Introduce ADD_DEBUG_DATA and REMOVE_DEBUG_DATA vm bind ops Mika Kuoppala
2026-11-09 13:55 ` [PATCH 11/20] drm/xe/eudebug: Introduce vm bind and vm bind debug data events Mika Kuoppala
2026-11-09 14:12   ` sashiko-bot
2026-11-09 13:55 ` [PATCH 12/20] drm/xe/eudebug: Add ufence events with acks Mika Kuoppala
2026-11-09 14:22   ` sashiko-bot
2026-11-09 13:55 ` [PATCH 13/20] drm/xe/eudebug: Add vm open/pread/pwrite Mika Kuoppala
2026-11-09 14:22   ` sashiko-bot
2026-11-09 13:55 ` [PATCH 14/20] drm/xe/eudebug: Add userptr vm pread/pwrite Mika Kuoppala
2026-11-09 13:55 ` [PATCH 15/20] drm/xe/eudebug: Add hw enablement Mika Kuoppala
2026-11-09 13:55 ` [PATCH 16/20] drm/xe/eudebug: Track debuggable exec queues Mika Kuoppala
2026-11-09 13:55 ` [PATCH 17/20] drm/xe/eudebug: Introduce EU control interface Mika Kuoppala
2026-11-09 14:35   ` sashiko-bot
2026-11-09 13:55 ` [PATCH 18/20] drm/xe/eudebug: Introduce per device attention scan worker Mika Kuoppala
2026-11-09 14:24   ` sashiko-bot
2026-11-09 13:55 ` [PATCH 19/20] drm/xe/eudebug_test: Introduce eudebug live tests Mika Kuoppala
2026-11-09 13:55 ` [PATCH 20/20] drm/xe: Add xe_client_debugfs and introduce debug_data file Mika Kuoppala

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=sashiko-outbox-205074@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=mika.kuoppala@linux.intel.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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.