[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#871608: linux-image-4.9.0-3-amd64: Linux kernel should handle decreasing cpu steal clock counter gracefully



> Am 25.09.2017 um 02:07 schrieb Ben Hutchings <ben@decadent.org.uk>:
> 
> I agree that the kernel ought to work around this, but I'm hesitant to
> add a fix that doesn't look like any upstream change.  Why and how do
> you think this was fixed in 4.11?

Indeed this patch is not included upstream and won’t be as it does not apply to the current development branch. See the following brief discussion on this on Linux stable: http://www.spinics.net/lists/stable/msg186915.html

The main issue here is the conversion between nsecs and cputime and how this behaves when the calculated difference in steal time overflows, i.e. decreases. In this case cpustat does not overflow and therefore decrease as well but instead increases by a large number. In Linux 4.11 the conversion between nsecs and cputime is entirely gone, which should lead to a backwards running cpustat counter without further issues (I have not actually tested this):

2b1f967d80e8e5d7361f0e1654c842869570f573  sched/cputime: Complete nsec conversion of tick based accounting

This change seems to be only the last commit of a larger change though and I’m not sure if this larger change is suitable for backporting.

I agree that it would be nice to have a patch which has undergone a good review process. Unfortunately I cannot provide that. I also cannot estimate how many people are affected by this issue considering that it did not attract attention over the last year.

Michael

Reply to: