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 5/5] Revert "drm/xe: Do not access xe file when updating exec queue run_ticks"
Date: Mon, 8 Jul 2024 21:33:40 +0000	[thread overview]
Message-ID: <ZoxbNHOdG1gnVkvx@DUT025-TGLU.fm.intel.com> (raw)
In-Reply-To: <20240708202103.3347869-6-umesh.nerlige.ramappa@intel.com>

On Mon, Jul 08, 2024 at 01:21:03PM -0700, Umesh Nerlige Ramappa wrote:
> This reverts commit ce62827bc294ba5f8b3909bfa5d7dbf9de8aab6b.
> 
> Closes: https://gitlab.freedesktop.org/drm/xe/kernel/issues/1908
> Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>

This looks right once the rest of my feedback from the series is addressed.

With that:
Reviewed-by: Matthew Brost <matthew.brost@intel.com>

> ---
>  drivers/gpu/drm/xe/xe_drm_client.c       | 5 +----
>  drivers/gpu/drm/xe/xe_exec_queue.c       | 5 ++++-
>  drivers/gpu/drm/xe/xe_exec_queue_types.h | 4 ----
>  3 files changed, 5 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_drm_client.c b/drivers/gpu/drm/xe/xe_drm_client.c
> index 6a26923fa10e..7ddd59908334 100644
> --- a/drivers/gpu/drm/xe/xe_drm_client.c
> +++ b/drivers/gpu/drm/xe/xe_drm_client.c
> @@ -251,11 +251,8 @@ static void show_run_ticks(struct drm_printer *p, struct drm_file *file)
>  
>  	/* Accumulate all the exec queues from this client */
>  	mutex_lock(&xef->exec_queue.lock);
> -	xa_for_each(&xef->exec_queue.xa, i, q) {
> +	xa_for_each(&xef->exec_queue.xa, i, q)
>  		xe_exec_queue_update_run_ticks(q);
> -		xef->run_ticks[q->class] += q->run_ticks - q->old_run_ticks;
> -		q->old_run_ticks = q->run_ticks;
> -	}
>  	mutex_unlock(&xef->exec_queue.lock);
>  
>  	/* Get the total GPU cycles */
> diff --git a/drivers/gpu/drm/xe/xe_exec_queue.c b/drivers/gpu/drm/xe/xe_exec_queue.c
> index b01eccdd75ba..719a70878fe2 100644
> --- a/drivers/gpu/drm/xe/xe_exec_queue.c
> +++ b/drivers/gpu/drm/xe/xe_exec_queue.c
> @@ -768,6 +768,7 @@ bool xe_exec_queue_is_idle(struct xe_exec_queue *q)
>   */
>  void xe_exec_queue_update_run_ticks(struct xe_exec_queue *q)
>  {
> +	struct xe_file *xef;
>  	struct xe_lrc *lrc;
>  	u32 old_ts, new_ts;
>  
> @@ -779,6 +780,8 @@ void xe_exec_queue_update_run_ticks(struct xe_exec_queue *q)
>  	if (!q->vm || !q->vm->xef)
>  		return;
>  
> +	xef = q->vm->xef;
> +
>  	/*
>  	 * Only sample the first LRC. For parallel submission, all of them are
>  	 * scheduled together and we compensate that below by multiplying by
> @@ -789,7 +792,7 @@ void xe_exec_queue_update_run_ticks(struct xe_exec_queue *q)
>  	 */
>  	lrc = q->lrc[0];
>  	new_ts = xe_lrc_update_timestamp(lrc, &old_ts);
> -	q->run_ticks += (new_ts - old_ts) * q->width;
> +	xef->run_ticks[q->class] += (new_ts - old_ts) * q->width;
>  }
>  
>  void xe_exec_queue_kill(struct xe_exec_queue *q)
> diff --git a/drivers/gpu/drm/xe/xe_exec_queue_types.h b/drivers/gpu/drm/xe/xe_exec_queue_types.h
> index f768e48f31e4..b5343cdd0632 100644
> --- a/drivers/gpu/drm/xe/xe_exec_queue_types.h
> +++ b/drivers/gpu/drm/xe/xe_exec_queue_types.h
> @@ -142,10 +142,6 @@ struct xe_exec_queue {
>  	 * Protected by @vm's resv. Unused if @vm == NULL.
>  	 */
>  	u64 tlb_flush_seqno;
> -	/** @old_run_ticks: prior hw engine class run time in ticks for this exec queue */
> -	u64 old_run_ticks;
> -	/** @run_ticks: hw engine class run time in ticks for this exec queue */
> -	u64 run_ticks;
>  	/** @lrc: logical ring context for this exec queue */
>  	struct xe_lrc *lrc[];
>  };
> -- 
> 2.38.1
> 

  reply	other threads:[~2024-07-08 21:34 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
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 [this message]
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=ZoxbNHOdG1gnVkvx@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