intel-xe.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/6] drm/xe: Per client usage
@ 2024-04-23 23:56 Lucas De Marchi
  2024-04-23 23:56 ` [PATCH v2 1/6] drm/xe/lrc: Add helper to capture context timestamp Lucas De Marchi
                   ` (12 more replies)
  0 siblings, 13 replies; 24+ messages in thread
From: Lucas De Marchi @ 2024-04-23 23:56 UTC (permalink / raw)
  To: intel-xe
  Cc: dri-devel, Umesh Nerlige Ramappa, Tvrtko Ursulin, Lucas De Marchi

Add per-client usage statistics to xe. This ports xe to use the common
method in drm to export the usage to userspace per client (where 1
client == 1 drm fd open).

However insted of using the current format measured in nsec, this
creates a new one. The intention here is not to mix the GPU clock domain
with the CPU clock. It allows to cover a few more use cases without
extra complications.

I tested this on DG2 and also checked gputop with i915 to make sure not
regressed. Last patch also contains the documentation for the new key
and sample output as requested in v1. Reproducing it partially here:

	- drm-total-cycles-<keystr>: <uint>

	Engine identifier string must be the same as the one specified in the
	drm-cycles-<keystr> tag and shall contain the total number cycles for the given
	engine.

	This is a timestamp in GPU unspecified unit that matches the update rate
	of drm-cycles-<keystr>. For drivers that implement this interface, the engine
	utilization can be calculated entirely on the GPU clock domain, without
	considering the CPU sleep time between 2 samples.

The pre-existent drm-cycles-<keystr> is used as is, which allows gputop
to work with xe.

v2:
  - Create a new drm-total-cycles instead of re-using drm-engine with a
    different unit
  - Add documentation for the new interface and clarify usage of
    xe_lrc_update_timestamp()

Test-with: https://lore.kernel.org/igt-dev/20240423234431.1959354-1-lucas.demarchi@intel.com/

Lucas De Marchi (4):
  drm/xe: Add helper to capture engine timestamp
  drm/xe: Promote xe_hw_engine_class_to_str()
  drm/xe: Add XE_ENGINE_CLASS_OTHER to str conversion
  drm/xe/client: Print runtime to fdinfo

Umesh Nerlige Ramappa (2):
  drm/xe/lrc: Add helper to capture context timestamp
  drm/xe: Add helper to accumulate exec queue runtime

 Documentation/gpu/drm-usage-stats.rst         |  16 +-
 Documentation/gpu/xe/index.rst                |   1 +
 Documentation/gpu/xe/xe-drm-usage-stats.rst   |  10 ++
 drivers/gpu/drm/xe/regs/xe_lrc_layout.h       |   1 +
 drivers/gpu/drm/xe/xe_device_types.h          |   9 ++
 drivers/gpu/drm/xe/xe_drm_client.c            | 138 +++++++++++++++++-
 drivers/gpu/drm/xe/xe_exec_queue.c            |  37 +++++
 drivers/gpu/drm/xe/xe_exec_queue.h            |   1 +
 drivers/gpu/drm/xe/xe_hw_engine.c             |  27 ++++
 drivers/gpu/drm/xe/xe_hw_engine.h             |   3 +
 drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c |  18 ---
 drivers/gpu/drm/xe/xe_lrc.c                   |  11 ++
 drivers/gpu/drm/xe/xe_lrc.h                   |  14 ++
 drivers/gpu/drm/xe/xe_lrc_types.h             |   3 +
 drivers/gpu/drm/xe/xe_sched_job.c             |   2 +
 15 files changed, 270 insertions(+), 21 deletions(-)
 create mode 100644 Documentation/gpu/xe/xe-drm-usage-stats.rst

-- 
2.43.0


^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2024-05-09  9:40 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-23 23:56 [PATCH v2 0/6] drm/xe: Per client usage Lucas De Marchi
2024-04-23 23:56 ` [PATCH v2 1/6] drm/xe/lrc: Add helper to capture context timestamp Lucas De Marchi
2024-04-23 23:56 ` [PATCH v2 2/6] drm/xe: Add helper to capture engine timestamp Lucas De Marchi
2024-04-23 23:56 ` [PATCH v2 3/6] drm/xe: Add helper to accumulate exec queue runtime Lucas De Marchi
2024-04-24  4:08   ` Matthew Brost
2024-04-24 14:51     ` Lucas De Marchi
2024-04-26 10:49   ` Tvrtko Ursulin
2024-04-26 18:59     ` Umesh Nerlige Ramappa
2024-04-29  8:07       ` Tvrtko Ursulin
2024-04-23 23:56 ` [PATCH v2 4/6] drm/xe: Promote xe_hw_engine_class_to_str() Lucas De Marchi
2024-04-23 23:56 ` [PATCH v2 5/6] drm/xe: Add XE_ENGINE_CLASS_OTHER to str conversion Lucas De Marchi
2024-04-23 23:56 ` [PATCH v2 6/6] drm/xe/client: Print runtime to fdinfo Lucas De Marchi
2024-04-26 10:47   ` Tvrtko Ursulin
2024-05-07 21:35     ` Lucas De Marchi
2024-05-08  8:23       ` Tvrtko Ursulin
2024-05-08 20:53         ` Lucas De Marchi
2024-05-09  9:39           ` Tvrtko Ursulin
2024-04-24  1:14 ` ✓ CI.Patch_applied: success for drm/xe: Per client usage (rev2) Patchwork
2024-04-24  1:14 ` ✗ CI.checkpatch: warning " Patchwork
2024-04-24  1:15 ` ✓ CI.KUnit: success " Patchwork
2024-04-24  1:27 ` ✓ CI.Build: " Patchwork
2024-04-24  1:29 ` ✓ CI.Hooks: " Patchwork
2024-04-24  1:31 ` ✓ CI.checksparse: " Patchwork
2024-04-24  1:53 ` ✓ CI.BAT: " Patchwork

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 NNTP newsgroup(s).