Re: [BUG linux-4.9.x] xen hotplug cpu leads to 100% steal usage

From: Thomas Gleixner
Date: Fri Mar 01 2019 - 18:44:04 EST


On Thu, 28 Feb 2019, Dongli Zhang wrote:
>
> The root cause is that the return type of jiffies_to_usecs() is 'unsigned int',
> but not 'unsigned long'. As a result, the leading 32 bits are discarded.

Errm. No. The root cause is that jiffies_to_usecs() is used for that in the
first place. The function has been that way forever and all usage sites
(except a broken dev_debug print in infiniband) feed delta values. Yes, it
could have documentation....

> jiffies_to_usecs() is indirectly triggered by cputime_to_nsecs() at line 264.
> If guest is already up for long time, the initial steal time for new vcpu might
> be large and the leading 32 bits of jiffies_to_usecs() would be discarded.

> So far, I have two solutions:
>
> 1. Change the return type from 'unsigned int' to 'unsigned long' as in above
> link and I am afraid it would bring side effect. The return type in latest
> mainline kernel is still 'unsigned int'.

Changing it to unsigned long would just solve the issue for 64bit.

Thanks,

tglx