Skip to content

RFC Per-context and per-client engine busyness

Tvrtko Ursulin intel-gfx 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 RFC Latest10 patches 5 repliesIn review
  2. v4 RFC7 patches 4 repliesSuperseded
  3. v21 patch 0 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v11 patch6 repliesSuperseded

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10drm/i915: Store engine backpointer in the intel_contextdrivers/gpu/drm/i915/i915_gem_context.c drivers/gpu/drm/i915/i915_gem_context.h+2 -00 replies
2/10drm/i915: Include i915_scheduler.h from i915_gem_context.hdrivers/gpu/drm/i915/i915_gem_context.h+1 -02 replies
3/10drm/i915: Forward declare struct intel_contextdrivers/gpu/drm/i915/i915_gem_context.h+2 -01 reply
4/10drm/i915: Move intel_engine_context_in/out into intel_lrc.cdrivers/gpu/drm/i915/intel_lrc.c drivers/gpu/drm/i915/intel_ringbuffer.h+57 -552 replies
5/10drm/i915: Track per-context engine busynessdrivers/gpu/drm/i915/i915_gem_context.c drivers/gpu/drm/i915/i915_gem_context.h drivers/gpu/drm/i915/intel_engine_cs.c +1 more+97 -100 replies
6/10drm/i915: Expose list of clients in sysfsdrivers/gpu/drm/i915/i915_drv.h drivers/gpu/drm/i915/i915_gem.c drivers/gpu/drm/i915/i915_sysfs.c+137 -70 replies
7/10drm/i915: Update client name on context createdrivers/gpu/drm/i915/i915_drv.h drivers/gpu/drm/i915/i915_gem.c drivers/gpu/drm/i915/i915_gem_context.c+23 -50 replies
8/10drm/i915: Expose per-engine client busynessdrivers/gpu/drm/i915/i915_drv.h drivers/gpu/drm/i915/i915_gem.c+85 -30 replies
9/10drm/i915: Add sysfs toggle to enable per-client engine statsdrivers/gpu/drm/i915/i915_drv.h drivers/gpu/drm/i915/i915_sysfs.c+76 -00 replies
10/10drm/i915: Allow clients to query own per-engine busynessdrivers/gpu/drm/i915/i915_gem_context.c drivers/gpu/drm/i915/i915_gem_context.h include/uapi/drm/i915_drm.h+117 -50 replies

Reviews trailers per patch

2 of 10 patches have a Reviewed-by or Acked-by.

PatchChris Wilson
1/10
2/10R-b
3/10R-b
4/10
5/10
6/10
7/10
8/10
9/10
10/10

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [RFC v5 00/10] Per-context and per-client engine busyness

From: Tvrtko Ursulin <[email protected]>

Another re-post of my earlier, now slightly updated work, to expose a DRM client hierarchy in sysfs in order to enable a top like tool:

intel-gpu-top - load avg 40.80, 27.11, 1.50; 882/ 950 MHz; 0% RC6; 13.26 Watts; 261903 irqs/s

IMC reads: 5543 MiB/s
IMC writes: 236 MiB/s

ENGINE BUSY QD MI_SEMA MI_WAIT
Render/3D/0 60.47% |███████████▍ | 28 0 1 0% 0%
Blitter/0 92.70% |█████████████████▌ | 0 0 1 0% 0%
Video/0 100.00% |███████████████████| 15 37 2 0% 0%
Video/1 51.68% |█████████▊ | 0 0 1 0% 0%
VideoEnhance/0 0.00% | | 0 0 0 0% 0%

PID NAME rcs0 bcs0 vcs0 vcs1 vecs0

21664        gem_wsim |█████▍   ||         ||█████████||████▋    ||         |
21662     gem_latency |         ||████████▎||         ||         ||         |
21662     gem_latency |         ||         ||         ||         ||         |

Hopefully the screen shot is self-explanatory. It shows overall GPU per-engine stats, plus per-client and per-engine busyness.

In this version we have a larger rebase on top of the recent code base changes, some of which made these patches cleaner.

Series now starts with four uninteresting patches, while patches 5 & 10 are what is asked for by the customer.

Patches 6-9 are the sysfs interface to per-client busyness which enables the above top like display. I am still sticking with sysfs since theoretically it could enable easy access control if so would be wanted one day. As discussed in the past something like this is not possible to expose via PMU.

I think in the future, as compute workloads become more prominent, having the ability to look at process GPU usage, along the CPU, will become more interesting.

Final note is that in any case patch 10 is blocked by the lack of open source userspace.

Tvrtko Ursulin (10):
drm/i915: Store engine backpointer in the intel_context drm/i915: Include i915_scheduler.h from i915_gem_context.h drm/i915: Forward declare struct intel_context drm/i915: Move intel_engine_context_in/out into intel_lrc.c drm/i915: Track per-context engine busyness drm/i915: Expose list of clients in sysfs drm/i915: Update client name on context create drm/i915: Expose per-engine client busyness drm/i915: Add sysfs toggle to enable per-client engine stats drm/i915: Allow clients to query own per-engine busyness

 drivers/gpu/drm/i915/i915_drv.h         |  39 +++++
 drivers/gpu/drm/i915/i915_gem.c         | 191 +++++++++++++++++++++++-
 drivers/gpu/drm/i915/i915_gem_context.c | 118 ++++++++++++++-
 drivers/gpu/drm/i915/i915_gem_context.h |  22 +++
 drivers/gpu/drm/i915/i915_sysfs.c       |  80 ++++++++++
 drivers/gpu/drm/i915/intel_engine_cs.c  |  27 ++++
 drivers/gpu/drm/i915/intel_lrc.c        | 107 ++++++++++++-
 drivers/gpu/drm/i915/intel_ringbuffer.h |  55 -------
 include/uapi/drm/i915_drm.h             |  21 +++
 9 files changed, 586 insertions(+), 74 deletions(-)
Signature · 6 lines
2.17.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx