Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] tests/intel/xe_pm_residency: Wait for a stable C6 before measuring residency
@ 2026-11-19  0:50 Zongyao Bai
  2026-11-19  0:50 ` [PATCH 1/3] lib/xe/xe_gt: Add xe_gt_wait_c6_stable() Zongyao Bai
                   ` (6 more replies)
  0 siblings, 7 replies; 11+ messages in thread
From: Zongyao Bai @ 2026-11-19  0:50 UTC (permalink / raw)
  To: igt-dev; +Cc: jia.yao, shuicheng.lin, Zongyao Bai

Several CI runs of xe_pm_residency@idle-residency@gt0 fail with only
~82% residency (allowed: 90%).

The test waits only once for xe_gt_is_in_c6() and then starts the 3s
measurement. That single sample can succeed on a transient visit to C6
while the GT is still being woken up by deferred work of the previous
test. Some asynchronous teardown (GuC deregistration, LRC/BO free, 
GGTT node removal and the resulting TLB invalidations on both GTs) 
may make GT out of C6 for ~0.8-1.4s after the test exits.

This series makes the C6 residency tests wait until the GT is really
idle before measuring, as a robustness fix independent of the order in
which tests are scheduled:

  1. add xe_gt_wait_c6_stable(): poll idle_status/idle_residency_ms every
     10ms and require the GT to stay in gt-c6 for a minimum window
     (with the residency counter advancing >= 95% of the window), with
     a timeout;
  2. use it in xe_pm_residency (idle-residency, gt-c6-freeze, and once
     before the C6 power sample in toggle-gt-c6);
  3. use it in xe_pmu@gt-c6-idle. 

The waits use 500ms / 5s. idle-residency-on-exec is intentionally not
changed because a workload is running while it measures. A GT that never
reaches stable C6 (e.g. forcewake held) still fails the test, after the
timeout.

Testing on a BMG-G21 DUT, running xe_pat@pat-index-auto followed
immediately by xe_pm_residency@idle-residency@gt0, 3 runs each:

  upstream master IGT:       3/3 fail, residency 67.8-78.5%
  this series:               3/3 pass, residency ~100%, the stable wait
                             took 1.37-1.68s
  this series + intel_bb fix: 3/3 pass, wait ~0.5s (minimum window)

Zongyao Bai (3):
  lib/xe/xe_gt: Add xe_gt_wait_c6_stable()
  tests/intel/xe_pm_residency: Wait for stable C6 before measuring
  tests/intel/xe_pmu: Wait for stable C6 in gt-c6-idle

 lib/xe/xe_gt.c                | 90 +++++++++++++++++++++++++++++++++++
 lib/xe/xe_gt.h                |  2 +
 tests/intel/xe_pm_residency.c | 21 ++++++--
 tests/intel/xe_pmu.c          |  4 +-
 4 files changed, 112 insertions(+), 5 deletions(-)

-- 
2.43.0


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

end of thread, other threads:[~2026-12-02 23:18 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-19  0:50 [PATCH 0/3] tests/intel/xe_pm_residency: Wait for a stable C6 before measuring residency Zongyao Bai
2026-11-19  0:50 ` [PATCH 1/3] lib/xe/xe_gt: Add xe_gt_wait_c6_stable() Zongyao Bai
2026-12-02 23:16   ` Yao, Jia
2026-11-19  0:50 ` [PATCH 2/3] tests/intel/xe_pm_residency: Wait for stable C6 before measuring Zongyao Bai
2026-12-02 23:14   ` Yao, Jia
2026-11-19  0:50 ` [PATCH 3/3] tests/intel/xe_pmu: Wait for stable C6 in gt-c6-idle Zongyao Bai
2026-12-02 23:16   ` Yao, Jia
2026-11-19  7:10 ` ✓ Xe.CI.BAT: success for tests/intel/xe_pm_residency: Wait for a stable C6 before measuring residency Patchwork
2026-11-19 13:06 ` ✓ i915.CI.BAT: " Patchwork
2026-11-20 10:20 ` ✓ Xe.CI.FULL: " Patchwork
2026-11-20 13:29 ` ✗ i915.CI.Full: failure " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox