<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEEDINFO "
   title="NEEDINFO - rc6_residency_ms unreliable"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=94852#c6">Comment # 6</a>
              on <a class="bz_bug_link 
          bz_status_NEEDINFO "
   title="NEEDINFO - rc6_residency_ms unreliable"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=94852">bug 94852</a>
              from <span class="vcard"><a class="email" href="mailto:lenb@kernel.org" title="Len Brown <lenb@kernel.org>"> <span class="fn">Len Brown</span></a>
</span></b>
        <pre>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</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
          <li>You are the assignee for the bug.</li>
          <li>You are the QA Contact for the bug.</li>
      </ul>
    </body>
</html>