Kernel: Linux-4.6.0-rc1 Hardware: SKL, HSW Description: Value read from /sys/class/drm/card0/power/rc6_residency_ms resets before it reaches 5500 seconds. This make it "somewhat awkward" to calculate residence from this counter, since it can effectively go backwards - or worse, appear to increment extremely slowly when it should really be incrementing quickly. turbostat has a workaround for former, but there is no workaround for the later. powertop does not have a workaround, it will just occasionally display garbage. Debug steps taken: booted both the SKL and HSW with cmdline "i915.enable_dc=0" but it made no difference. To Reproduce: while /bin/true; do cat /sys/class/drm/card0/power/rc6_residency_ms; sleep 1; done ... 5491367 5492352 5493334 5494326 5495307 5496299 5497280 703 1685 2677 3658 4650 5631 6612
The source of the information is GEN6_GT_GFX_RC6, a 32-bit register containing the residency since boot in units of 1.28 us. The register wraps around at about 5497.6 seconds, consistent with the report.
For discussion: https://patchwork.freedesktop.org/patch/79932/
Reference to Mika's patch: https://patchwork.freedesktop.org/series/20578/
Len - related to solution ongoing (see comment 3). Would that work for your case?
(In reply to Jari Tahvanainen from comment #4) > Len - related to solution ongoing (see comment 3). Would that work for your > case? No. If the bug was opened because it is awkward to handle a wrap at 90 minutes, a wrap at 50 minutes is still not good enough.
turbostat does not poll, it reads the value at the start of a measurement interval, and then reads it again at the end. the measurement interval can be of arbitrary length, (and multiple copies of turbostat could be running at the same time with different measurement intervals) turbostat has a sanity check that the ending value is not smaller than the starting value, but that detects only 1 wrap, and if there have been multiple wraps, it will print erroneous results. turbostat opens and closes the sysfs file for each of these reads. Yes, this problem is much more in-your-face on BYT, which appears to have a wrap at about 13 seconds (Linux-4.10) while /bin/true; do cat /sys/class/drm/card0/power/rc6_residency_ms; sleep 1; done 1394 2408 3423 4436 5451 6463 7474 8488 9503 10516 11529 12542 671 1685 2699 3713 4727 5741 6753 7767 8781 9794 10807 11821 12835 964 1977 2992 4005 5018 6032 7046 8060 9073 10087 11101 12114 243 1255 2268 3283 4295 5309 6323 7334 8349 9363 10374 11386 12401 529
First of all. Sorry about spam. This is mass update for our bugs. Sorry if you feel this annoying but with this trying to understand if bug still valid or not. If bug investigation still in progress, please ignore this and I apologize! If you think this is not anymore valid, please comment to the bug that can be closed. If you haven't tested with our latest pre-upstream tree(drm-tip), can you do that also to see if issue is valid there still and if you cannot see issue there, please comment to the bug.
Closing, please re-open if still occurs.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.