Skip to content

RFC Per context and per client GPU busyness tracking

Tvrtko Ursulin intel-gfx 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest6 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6drm/i915: Move intel_engine_context_in/out into intel_lrc.cdrivers/gpu/drm/i915/gt/intel_engine.h drivers/gpu/drm/i915/gt/intel_lrc.c+57 -550 replies
2/6drm/i915: Track per-context engine busynessdrivers/gpu/drm/i915/gt/intel_context.c drivers/gpu/drm/i915/gt/intel_context.h drivers/gpu/drm/i915/gt/intel_context_types.h +2 more+99 -101 reply
3/6drm/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+140 -81 reply
4/6drm/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+25 -50 replies
5/6drm/i915: Expose per-engine client busynessdrivers/gpu/drm/i915/i915_drv.h drivers/gpu/drm/i915/i915_gem.c+106 -42 replies
6/6drm/i915: Add sysfs toggle to enable per-client engine statsdrivers/gpu/drm/i915/i915_drv.h drivers/gpu/drm/i915/i915_sysfs.c+77 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC 0/6] Per context and per client GPU busyness tracking

From: Tvrtko Ursulin <[email protected]>

Continuation of the old feature work, rebased to latest drm-tip and adapted to expose data per engine class - making it compatible with the upcoming Virtual Engine uapi.

Patch series adds core per context (intel_context) engine busyness tracking and then also exports this data in sysfs, aggregated to per client and per engine class.

Exported directory structure looks like this:

root@sc:/sys/class/drm/card0# grep  . -r clients/
clients/21/busy/3:0
clients/21/busy/1:0
clients/21/busy/2:24712242825
clients/21/busy/0:7830006484
clients/21/pid:5989
clients/21/name:gem_wsim
clients/22/busy/3:0
clients/22/busy/1:2778102816
clients/22/busy/2:0
clients/22/busy/0:14434594580
clients/22/pid:5991
clients/22/name:gem_wsim
clients/enable_stats:1

Each client has an opaque unique id named directory, under which are its name, pid, and another subdirectory containing accumulated engine busyness per engine class in nanoseconds.

Example output from extended intel_gpu_top:

==========================================================================
intel-gpu-top - 935/ 935 MHz; 0% RC6; 14.73 Watts; 1097 irqs/s

IMC reads: 1401 MiB/s
IMC writes: 4 MiB/s

ENGINE BUSY MI_SEMA MI_WAIT
Render/3D/0 63.73% |███████████████████ | 3% 0%
Blitter/0 9.53% |██▊ | 6% 0%
Video/0 39.32% |███████████▊ | 16% 0%
Video/1 15.62% |████▋ | 0% 0%
VideoEnhance/0 0.00% | | 0% 0%

PID NAME RCS BCS VCS VECS

 4084        gem_wsim |█████▌     ||█          ||           ||           |
 4086        gem_wsim |█▌         ||           ||███        ||           |

==========================================================================

Tvrtko Ursulin (6):
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

 drivers/gpu/drm/i915/gt/intel_context.c       |  21 ++
 drivers/gpu/drm/i915/gt/intel_context.h       |   9 +
 drivers/gpu/drm/i915/gt/intel_context_types.h |   9 +
 drivers/gpu/drm/i915/gt/intel_engine.h        |  55 -----
 drivers/gpu/drm/i915/gt/intel_engine_cs.c     |   8 +
 drivers/gpu/drm/i915/gt/intel_lrc.c           | 107 ++++++++-
 drivers/gpu/drm/i915/i915_drv.h               |  39 ++++
 drivers/gpu/drm/i915/i915_gem.c               | 215 +++++++++++++++++-
 drivers/gpu/drm/i915/i915_gem_context.c       |  18 +-
 drivers/gpu/drm/i915/i915_sysfs.c             |  81 +++++++
 10 files changed, 492 insertions(+), 70 deletions(-)
Signature · 6 lines
2.19.1

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