On Sun, 22 Jan 2017 19:20:13 +0100 Frederic Weisbecker <[email protected]> wrote:
> The s390 clock has a higher granularity than nanoseconds. 1 nanosec > equals 4.096 in s390 cputime_t. Therefore we leak a remainder while > flushing the cputime through cputime_to_nsecs(). > > For more precision, make sure we keep that remainder on cputime > accumulators for later accounting. > > Reported-by: Martin Schwidefsky <[email protected]> > Cc: Benjamin Herrenschmidt <[email protected]> > Cc: Paul Mackerras <[email protected]> > Cc: Michael Ellerman <[email protected]> > Cc: Heiko Carstens <[email protected]> > Cc: Martin Schwidefsky <[email protected]> > Cc: Tony Luck <[email protected]> > Cc: Fenghua Yu <[email protected]> > Cc: Peter Zijlstra <[email protected]> > Cc: Rik van Riel <[email protected]> > Cc: Thomas Gleixner <[email protected]> > Cc: Ingo Molnar <[email protected]> > Cc: Stanislaw Gruszka <[email protected]> > Cc: Wanpeng Li <[email protected]> > Signed-off-by: Frederic Weisbecker <[email protected]> NAK. Good intention but the patch is just broken. with 36 of the 37 patches applied all looks good but the last one completely breaks the accounting for s390. This is from an idle system: top - 10:39:33 up 0 min, 1 user, load average: 0,00, 0,00, 0,00 Tasks: 106 total, 1 running, 105 sleeping, 0 stopped, 0 zombie %Cpu0 : 8,9 us, 21,6 sy, 0,0 ni, 0,0 id, 0,0 wa, 10,8 hi, 4,3 si, 54,4 st %Cpu1 : 0,0 us, 23,5 sy, 0,0 ni, 0,0 id, 0,0 wa, 19,0 hi, 13,1 si, 44,3 st %Cpu2 : 0,0 us, 30,3 sy, 0,0 ni, 0,0 id, 0,0 wa, 14,7 hi, 14,8 si, 40,2 st KiB Mem : 1009304 total, 818808 free, 57284 used, 133212 buff/cache KiB Swap: 1048556 total, 1048556 free, 0 used. 917356 avail Mem There is another issue that affects precision, there is no s390 specific version of cputime_to_nsecs. The generic version uses cputime_to_usecs and mulitplies by 1000 to get nano-seconds. That already looses precision. For now just drop that last patch please. -- blue skies, Martin. "Reality continues to ruin my life." - Calvin.

