Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Brost <matthew.brost@intel.com>
To: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Cc: <intel-xe@lists.freedesktop.org>, <lucas.demarchi@intel.com>
Subject: Re: [PATCH 3/5] drm/xe: Take a reference to xe file when user creates exec_queue
Date: Mon, 8 Jul 2024 21:25:29 +0000	[thread overview]
Message-ID: <ZoxZSQQDbOVgo6uM@DUT025-TGLU.fm.intel.com> (raw)
In-Reply-To: <20240708202103.3347869-4-umesh.nerlige.ramappa@intel.com>

On Mon, Jul 08, 2024 at 01:21:01PM -0700, Umesh Nerlige Ramappa wrote:
> Take a reference to xe file object when user creates an exec queue so
> that the xe file object is available for the lifetime of the queue.
> 
> Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
> ---
>  drivers/gpu/drm/xe/xe_exec_queue.c       | 6 ++++++
>  drivers/gpu/drm/xe/xe_exec_queue_types.h | 3 +++
>  2 files changed, 9 insertions(+)
> 
> diff --git a/drivers/gpu/drm/xe/xe_exec_queue.c b/drivers/gpu/drm/xe/xe_exec_queue.c
> index 0ba37835849b..b01eccdd75ba 100644
> --- a/drivers/gpu/drm/xe/xe_exec_queue.c
> +++ b/drivers/gpu/drm/xe/xe_exec_queue.c
> @@ -37,6 +37,10 @@ static void __xe_exec_queue_free(struct xe_exec_queue *q)
>  {
>  	if (q->vm)
>  		xe_vm_put(q->vm);
> +
> +	if (q->xef)
> +		xe_file_put(q->xef);
> +
>  	kfree(q);
>  }
>  
> @@ -640,6 +644,8 @@ int xe_exec_queue_create_ioctl(struct drm_device *dev, void *data,
>  			if (XE_IOCTL_DBG(xe, err))
>  				goto put_exec_queue;
>  		}
> +
> +		q->xef = xe_file_get(xef);

This doesn't look like the right place. All exec queues include VM bind
ones should have a ref.

With that, the right place seems to be right before or after args->exec_queue_id = id;

Matt

>  	}
>  
>  	mutex_lock(&xef->exec_queue.lock);
> diff --git a/drivers/gpu/drm/xe/xe_exec_queue_types.h b/drivers/gpu/drm/xe/xe_exec_queue_types.h
> index ded9f9396429..f768e48f31e4 100644
> --- a/drivers/gpu/drm/xe/xe_exec_queue_types.h
> +++ b/drivers/gpu/drm/xe/xe_exec_queue_types.h
> @@ -38,6 +38,9 @@ enum xe_exec_queue_priority {
>   * a kernel object.
>   */
>  struct xe_exec_queue {
> +	/** @xef: Back pointer to xe file is this is user created exec queue */
> +	struct xe_file *xef;
> +
>  	/** @gt: graphics tile this exec queue can submit to */
>  	struct xe_gt *gt;
>  	/**
> -- 
> 2.38.1
> 

  reply	other threads:[~2024-07-08 21:26 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-08 20:20 [PATCH 0/5] Have xe_vm and xe_exec_queue take references to xef Umesh Nerlige Ramappa
2024-07-08 20:20 ` [PATCH 1/5] drm/xe: Move part of xe_file cleanup to a helper Umesh Nerlige Ramappa
2024-07-08 21:21   ` Matthew Brost
2024-07-08 22:12     ` Umesh Nerlige Ramappa
2024-07-08 22:18       ` Matthew Brost
2024-07-08 20:21 ` [PATCH 2/5] drm/xe: Add ref counting for xe_file Umesh Nerlige Ramappa
2024-07-08 21:23   ` Matthew Brost
2024-07-08 22:15     ` Umesh Nerlige Ramappa
2024-07-08 22:19       ` Matthew Brost
2024-07-08 23:00     ` Umesh Nerlige Ramappa
2024-07-08 22:52   ` Lucas De Marchi
2024-07-08 23:26     ` Umesh Nerlige Ramappa
2024-07-09  0:28       ` Matthew Brost
2024-07-09 15:11         ` Lucas De Marchi
2024-07-09 16:37           ` Umesh Nerlige Ramappa
2024-07-09 20:37             ` Matthew Brost
2024-07-11 13:46               ` Lucas De Marchi
2024-07-08 20:21 ` [PATCH 3/5] drm/xe: Take a reference to xe file when user creates exec_queue Umesh Nerlige Ramappa
2024-07-08 21:25   ` Matthew Brost [this message]
2024-07-08 20:21 ` [PATCH 4/5] drm/xe: Take a ref to xe file when user creates a VM Umesh Nerlige Ramappa
2024-07-08 21:32   ` Matthew Brost
2024-07-08 20:21 ` [PATCH 5/5] Revert "drm/xe: Do not access xe file when updating exec queue run_ticks" Umesh Nerlige Ramappa
2024-07-08 21:33   ` Matthew Brost
2024-07-08 20:26 ` ✓ CI.Patch_applied: success for Have xe_vm and xe_exec_queue take references to xef Patchwork
2024-07-08 20:27 ` ✓ CI.checkpatch: " Patchwork
2024-07-08 20:28 ` ✓ CI.KUnit: " Patchwork
2024-07-08 20:40 ` ✓ CI.Build: " Patchwork
2024-07-08 20:42 ` ✓ CI.Hooks: " Patchwork
2024-07-08 20:43 ` ✓ CI.checksparse: " Patchwork
2024-07-08 21:16 ` ✗ CI.BAT: failure " Patchwork
2024-07-08 21:37 ` [PATCH 0/5] " Lucas De Marchi
2024-07-09  1:07 ` ✗ CI.FULL: failure for " 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=ZoxZSQQDbOVgo6uM@DUT025-TGLU.fm.intel.com \
    --to=matthew.brost@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    --cc=umesh.nerlige.ramappa@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox