All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dongli Zhang <dongli.zhang@oracle.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: jgross@suse.com,
	Herbert Van Den Bergh <herbert.van.den.bergh@oracle.com>,
	sstabellini@kernel.org, sboyd@kernel.org, joe.jin@oracle.com,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	john.stultz@linaro.org, xen-devel@lists.xenproject.org,
	boris.ostrovsky@oracle.com
Subject: Re: [BUG linux-4.9.x] xen hotplug cpu leads to 100% steal usage
Date: Tue, 5 Mar 2019 10:19:42 +0800	[thread overview]
Message-ID: <22c1eb51-1e09-3eb4-f88a-d404b4ffcdb4__46657.6957072661$1551752224$gmane$org@oracle.com> (raw)
In-Reply-To: <alpine.DEB.2.21.1903020030320.1638@nanos.tec.linutronix.de>

Hi Thomas,

On 3/2/19 7:43 AM, Thomas Gleixner wrote:
> 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....

Thank you very much for the explanation. It would help the developers clarify
the usage of jiffies_to_usecs() (which we should always feed with dealt value)
with comments above it.

Indeed, the input value in this bug is also a delta value. Because of the
special mechanisms used by xen to account steal clock, the initial delta value
is always very large, only when the new cpu is added after the VM is already up
for very long time.

Dongli Zhang


> 
>> 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
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2019-03-05  2:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-01  2:35 [BUG linux-4.9.x] xen hotplug cpu leads to 100% steal usage Dongli Zhang
2019-03-01 23:43 ` Thomas Gleixner
2019-03-01 23:43 ` Thomas Gleixner
2019-03-05  2:19   ` Dongli Zhang [this message]
2019-03-05  2:19   ` Dongli Zhang
2019-03-04  8:14 ` Juergen Gross
2019-03-05  2:14   ` Dongli Zhang
2019-03-05  2:14   ` Dongli Zhang
2019-03-04  8:14 ` Juergen Gross
  -- strict thread matches above, loose matches on Subject: below --
2019-03-01  2:35 Dongli Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='22c1eb51-1e09-3eb4-f88a-d404b4ffcdb4__46657.6957072661$1551752224$gmane$org@oracle.com' \
    --to=dongli.zhang@oracle.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=herbert.van.den.bergh@oracle.com \
    --cc=jgross@suse.com \
    --cc=joe.jin@oracle.com \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sboyd@kernel.org \
    --cc=sstabellini@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.