]> git.ipfire.org Git - thirdparty/linux.git/commit
drm/i915/pmu: Fix zero delta busyness issue
authorUmesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Thu, 23 Jan 2025 19:38:39 +0000 (11:38 -0800)
committerUmesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Mon, 27 Jan 2025 21:06:17 +0000 (13:06 -0800)
commit431b742e2bfc9f6dd713f261629741980996d001
treef2162e48e1c447236c1a5ca6c61b924fc6ae595c
parent93b69c0482cf2a18d078fb1edefb4b84130838af
drm/i915/pmu: Fix zero delta busyness issue

When running igt@gem_exec_balancer@individual for multiple iterations,
it is seen that the delta busyness returned by PMU is 0. The issue stems
from a combination of 2 implementation specific details:

1) gt_park is throttling __update_guc_busyness_stats() so that it does
not hog PCI bandwidth for some use cases. (Ref: 59bcdb564b3ba)

2) busyness implementation always returns monotonically increasing
counters. (Ref: cf907f6d29421)

If an application queried an engine while it was active,
engine->stats.guc.running is set to true. Following that, if all PM
wakeref's are released, then gt is parked. At this time the throttling
of __update_guc_busyness_stats() may result in a missed update to the
running state of the engine (due to (1) above). This means subsequent
calls to guc_engine_busyness() will think that the engine is still
running and they will keep updating the cached counter (stats->total).
This results in an inflated cached counter.

Later when the application runs a workload and queries for busyness, we
return the cached value since it is larger than the actual value (due to
(2) above)

All subsequent queries will return the same large (inflated) value, so
the application sees a delta busyness of zero.

Fix the issue by resetting the running state of engines each time
intel_guc_busyness_park() is called.

v2: (Rodrigo)
- Use the correct tag in commit message
- Drop the redundant wakeref check in guc_engine_busyness() and update
  commit message

Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/13366
Fixes: cf907f6d2942 ("i915/guc: Ensure busyness counter increases motonically")
Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250123193839.2394694-1-umesh.nerlige.ramappa@intel.com
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c