[PATCH v2 0/8] Engine Busyness

Umesh Nerlige Ramappa umesh.nerlige.ramappa at intel.com
Thu Dec 14 01:56:18 UTC 2023


On Thu, Dec 07, 2023 at 02:45:47PM +0000, Tvrtko Ursulin wrote:
>
>Hi,
>
>On 07/12/2023 12:57, Riana Tauro wrote:
>>GuC provides engine busyness ticks as a 64 bit counter which count
>>as clock ticks. These counters are maintained in a
>>shared memory buffer and internally updated on a continuous basis.
>>
>>GuC also provides a periodically total active ticks that GT has been
>>active for. This counter is exposed to the user such that busyness can
>>be calculated as a percentage using
>>
>>busyness % = (engine active ticks/total active ticks) * 100.
>
>I think I've asked this before but don't remember it was clarified - 
>what are the semantics of "active" with total active ticks? In other 
>words considering activity timelines like:
>
>1)
>     0          1s
>rcs0 |xxxxx-----|
>bcs0 |-----xxxxx|
>
>2)
>     0          1s
>rcs0 |xxxxx-----|
>bcs0 |xxxxx-----|
>
>Assuming 1s sampling, would the above formula correctly say 50% for 
>both engines in both cases?

Yes. What is the significance of case 2? Are you saying rcs and bcs are 
executing in parallel?

Either ways, when total active ticks is queried it would provide the 
latest value of the active time (does not depend on gt park/unpark since 
the value is either obtained on demand from GuC or is a value that is 
frequently updated by GuC.

The duration of context (in to out) is accumulated for the each engine.

>
>I am also curious if there are plans to add support to intel_gpu_top 
>in which case please copy me on the required refactorings.
>

Certainly. It's in the works.

Thanks,
Umesh

>Regards,
>
>Tvrtko
>
>>This can be listed as
>>
>>sudo ./perf list
>>      xe_0000_03_00.0/total-active-ticks-gt0/            [Kernel PMU event]
>>      xe_0000_03_00.0/bcs0-busy-ticks-gt0/               [Kernel PMU event]
>>      xe_0000_03_00.0/ccs0-busy-ticks-gt0/               [Kernel PMU event]
>>      xe_0000_03_00.0/rcs0-busy-ticks-gt0/               [Kernel PMU event]
>>      xe_0000_03_00.0/vcs0-busy-ticks-gt0/               [Kernel PMU event]
>>      xe_0000_03_00.0/vecs0-busy-ticks-gt0/              [Kernel PMU event]
>>
>>and can be read as
>>
>>	sudo ./perf stat -e xe_0000_03_00.0/bcs0-busy-ticks-gt0/,xe_0000_03_00.0/total-active-ticks-gt0/  -I 1000
>>
>>v2: rebase
>>     fix review comments
>>
>>Riana Tauro (8):
>>   RFC drm/xe: Move user engine class mappings to functions
>>   RFC drm/xe/guc: Add interface for engine busyness ticks
>>   RFC drm/xe/guc: Expose engine busyness only for supported GuC version
>>   RFC drm/xe/guc: Add PMU counter for total active ticks
>>   RFC drm/xe/uapi: Add configs for Engine busyness
>>   RFC drm/xe/pmu: Add PMU counters for engine busy ticks
>>   RFC drm/xe/guc: Dynamically enable/disable engine busyness stats
>>   RFC drm/xe/guc: Handle runtime suspend issues for engine busyness
>>
>>  drivers/gpu/drm/xe/Makefile                 |   1 +
>>  drivers/gpu/drm/xe/abi/guc_actions_abi.h    |   1 +
>>  drivers/gpu/drm/xe/xe_exec_queue.c          |  19 +-
>>  drivers/gpu/drm/xe/xe_gt.c                  |  26 ++
>>  drivers/gpu/drm/xe/xe_gt.h                  |   3 +
>>  drivers/gpu/drm/xe/xe_guc.c                 |   7 +
>>  drivers/gpu/drm/xe/xe_guc_engine_busyness.c | 367 ++++++++++++++++++++
>>  drivers/gpu/drm/xe/xe_guc_engine_busyness.h |  21 ++
>>  drivers/gpu/drm/xe/xe_guc_fwif.h            |  15 +
>>  drivers/gpu/drm/xe/xe_guc_types.h           |  25 ++
>>  drivers/gpu/drm/xe/xe_hw_engine.c           |  50 +++
>>  drivers/gpu/drm/xe/xe_hw_engine.h           |   3 +
>>  drivers/gpu/drm/xe/xe_pmu.c                 | 189 +++++++++-
>>  drivers/gpu/drm/xe/xe_pmu.h                 |   2 +
>>  drivers/gpu/drm/xe/xe_query.c               |  23 +-
>>  include/uapi/drm/xe_drm.h                   |  24 ++
>>  16 files changed, 726 insertions(+), 50 deletions(-)
>>  create mode 100644 drivers/gpu/drm/xe/xe_guc_engine_busyness.c
>>  create mode 100644 drivers/gpu/drm/xe/xe_guc_engine_busyness.h
>>


More information about the Intel-xe mailing list