dri-devel Archive mirror
 help / color / mirror / Atom feed
From: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: <intel-xe@lists.freedesktop.org>,
	Tvrtko Ursulin <tursulin@ursulin.net>,
	<dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH v3 5/6] drm/xe: Add helper to accumulate exec queue runtime
Date: Tue, 7 May 2024 16:45:36 -0700	[thread overview]
Message-ID: <Zjq9IDk2xKtuOUYT@orsosgc001> (raw)
In-Reply-To: <20240507224510.442971-6-lucas.demarchi@intel.com>

On Tue, May 07, 2024 at 03:45:09PM -0700, Lucas De Marchi wrote:
>From: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
>
>Add a helper to accumulate per-client runtime of all its
>exec queues. This is called every time a sched job is finished.
>
>v2:
>  - Use guc_exec_queue_free_job() and execlist_job_free() to accumulate
>    runtime when job is finished since xe_sched_job_completed() is not a
>    notification that job finished.
>  - Stop trying to update runtime from xe_exec_queue_fini() - that is
>    redundant and may happen after xef is closed, leading to a
>    use-after-free
>  - Do not special case the first timestamp read: the default LRC sets
>    CTX_TIMESTAMP to zero, so even the first sample should be a valid
>    one.
>  - Handle the parallel submission case by multiplying the runtime by
>    width.
>
>Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
>Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
>---
> drivers/gpu/drm/xe/xe_device_types.h |  9 +++++++
> drivers/gpu/drm/xe/xe_exec_queue.c   | 35 ++++++++++++++++++++++++++++
> drivers/gpu/drm/xe/xe_exec_queue.h   |  1 +
> drivers/gpu/drm/xe/xe_execlist.c     |  1 +
> drivers/gpu/drm/xe/xe_guc_submit.c   |  2 ++
> 5 files changed, 48 insertions(+)
>
>diff --git a/drivers/gpu/drm/xe/xe_device_types.h b/drivers/gpu/drm/xe/xe_device_types.h
>index 906b98fb973b..de078bdf0ab9 100644
>--- a/drivers/gpu/drm/xe/xe_device_types.h
>+++ b/drivers/gpu/drm/xe/xe_device_types.h
>@@ -560,6 +560,15 @@ struct xe_file {
> 		struct mutex lock;
> 	} exec_queue;
>
>+	/**
>+	 * @runtime: hw engine class runtime in ticks for this drm client
>+	 *
>+	 * Only stats from xe_exec_queue->lrc[0] are accumulated. For multi-lrc
>+	 * case, since all jobs run in parallel on the engines, only the stats
>+	 * from lrc[0] are sufficient.

Maybe we can drop the above comment altogether after the multi-lrc 
update.

Umesh

  reply	other threads:[~2024-05-07 23:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-07 22:45 [PATCH v3 0/6] drm/xe: Per client usage Lucas De Marchi
2024-05-07 22:45 ` [PATCH v3 1/6] drm/xe: Promote xe_hw_engine_class_to_str() Lucas De Marchi
2024-05-07 22:45 ` [PATCH v3 2/6] drm/xe: Add XE_ENGINE_CLASS_OTHER to str conversion Lucas De Marchi
2024-05-07 22:45 ` [PATCH v3 3/6] drm/xe/lrc: Add helper to capture context timestamp Lucas De Marchi
2024-05-07 22:45 ` [PATCH v3 4/6] drm/xe: Add helper to capture engine timestamp Lucas De Marchi
2024-05-07 22:45 ` [PATCH v3 5/6] drm/xe: Add helper to accumulate exec queue runtime Lucas De Marchi
2024-05-07 23:45   ` Umesh Nerlige Ramappa [this message]
2024-05-08  3:29     ` Lucas De Marchi
2024-05-08  8:34   ` Tvrtko Ursulin
2024-05-08 12:44     ` Lucas De Marchi
2024-05-07 22:45 ` [PATCH v3 6/6] drm/xe/client: Print runtime to fdinfo Lucas De Marchi
2024-05-08  1:11   ` Umesh Nerlige Ramappa

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=Zjq9IDk2xKtuOUYT@orsosgc001 \
    --to=umesh.nerlige.ramappa@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    --cc=tursulin@ursulin.net \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).