Skip to content

intel: read the xe GT frequency from sysfs, not a perf event - #519

Open
stolk wants to merge 1 commit into
Syllo:masterfrom
stolk:fix/xe-freq-no-forcewake
Open

stolk wants to merge 1 commit into
Syllo:masterfrom
stolk:fix/xe-freq-no-forcewake

Conversation

@stolk

@stolk stolk commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

The xe PMU takes GT forcewake when a gt-actual-frequency event is created and only drops it when the event is destroyed (xe_pmu_event_init / xe_pmu_event_destroy). nvtop keeps that event open for its whole run, so the GT never enters RC6 while nvtop is running, and the clock stays wherever it was when nvtop started.

Measured on two Arc Pro B70 cards at idle (hwmon card energy): 44-46 W per card with no nvtop and RC6 at 99-100%. With nvtop running: RC6 at 0% and 4-36 W extra per card, depending on the clock the GT was held at (400-2700 MHz).

On xe, skip the perf event and read tile0/gt0/freq0/act_freq instead. It reports the actual frequency, 0 while the GT is in RC6, without holding forcewake. With this change, idle power and RC6 residency with nvtop running match having no nvtop at all. i915 keeps using the perf event.

The xe PMU takes GT forcewake when a gt-actual-frequency event is created
and only drops it when the event is destroyed (xe_pmu_event_init /
xe_pmu_event_destroy). nvtop keeps that event open for its whole run, so
the GT never enters RC6 while nvtop is running, and the clock stays
wherever it was when nvtop started.

Measured on two Arc Pro B70 cards at idle (hwmon card energy): 44-46 W
per card with no nvtop and RC6 at 99-100%. With nvtop running: RC6 at 0%
and 4-36 W extra per card, depending on the clock the GT was held at
(400-2700 MHz).

On xe, skip the perf event and read tile0/gt0/freq0/act_freq instead. It
reports the actual frequency, 0 while the GT is in RC6, without holding
forcewake. With this change, idle power and RC6 residency with nvtop
running match having no nvtop at all. i915 keeps using the perf event.

Signed-off-by: Bram Stolk <b.stolk@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@Steve-Tech Steve-Tech left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for finding and working on this!

I had previously (wrongly) thought that a reading of 0 was invalid, but if sysfs works perfectly, then I'm thinking of maybe reverting my two perf commits.

Also, out of curiosity, do you know if i915 is unaffected? (I can also test i915 eventually, if you're unable to)

@stolk

stolk commented Sep 30, 2026

Copy link
Copy Markdown
Contributor Author

Also, out of curiosity, do you know if i915 is unaffected? (I can also test i915 eventually, if you're unable to)

So, nvtop on my laptop with TigerLake-LP GT2 (driver i915) shows: POW N/A in nvtop.
But energygraph shows no extra load from nvtop on that laptop.
So almost certainly not affected?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants