From: Juergen Gross <jgross@suse.com>
To: Boris Ostrovsky <boris.ostrovsky@oracle.com>,
David Vrabel <david.vrabel@citrix.com>,
xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org
Cc: sstabellini@kernel.org
Subject: Re: [PATCH] xen: add steal_clock support on x86
Date: Wed, 18 May 2016 18:00:08 +0200 [thread overview]
Message-ID: <573C9188.7010303@suse.com> (raw)
In-Reply-To: <573C8FEA.2070407@oracle.com>
On 18/05/16 17:53, Boris Ostrovsky wrote:
> On 05/18/2016 11:45 AM, David Vrabel wrote:
>> On 18/05/16 16:42, Juergen Gross wrote:
>>> On 18/05/16 17:25, Boris Ostrovsky wrote:
>>>> On 05/18/2016 10:53 AM, Juergen Gross wrote:
>>>>> On 18/05/16 16:46, Boris Ostrovsky wrote:
>>>>>> On 05/18/2016 08:15 AM, Juergen Gross wrote:
>>>>>>> }
>>>>>>>
>>>>>>> +void __init xen_time_setup_guest(void)
>>>>>>> +{
>>>>>>> + pv_time_ops.steal_clock = xen_steal_clock;
>>>>>>> +
>>>>>>> + static_key_slow_inc(¶virt_steal_enabled);
>>>>>>> + /*
>>>>>>> + * We can't set paravirt_steal_rq_enabled as this would require the
>>>>>>> + * capability to read another cpu's runstate info.
>>>>>>> + */
>>>>>>> +}
>>>>>> Won't we be accounting for stolen cycles twice now --- once from
>>>>>> steal_account_process_tick()->steal_clock() and second time from
>>>>>> do_stolen_accounting()?
>>>>> Uuh, yes.
>>>>>
>>>>> I guess I should rip do_stolen_accounting() out, too?
>>>> I don't think PARAVIRT_TIME_ACCOUNTING is always selected for Xen. If
>>> This is easy to accomplish. :-)
>
>
> I looked at KVM code (PARAVIRT_TIME_ACCOUNTING is not selected there
> neither) and in their case that's presumably because stealing accounting
> is a CPUID bit, i.e. it might not be supported. In Xen case we always
> have this interface.
So they added it later and the default is to keep the old behavior.
>>>> that's indeed the case then we should ifndef do_stolen_accounting(). Or
>>>> maybe check for paravirt_steal_enabled.
>>> Is this really a sensible thing to do? There is a mechanism used by KVM
>>> to do the stolen accounting. I think we should use it instead of having
>>> a second implementation doing the same thing in case the generic one
>>> isn't enabled.
>> I agree.
>>
>> Although I don't think selecting PARAVIRT_TIME_ACC' is necessary -- I
>> don't think it's essential (or is it?).
>
> Looks like it's useful only if paravirt_steal_rq_enabled, which we don't
> support yet.
I think the patch is still useful. It is reducing code size and
it is removing arch-specific Xen-hack(s). With the patch Xen's
solution for arm and x86 is common and the same as for KVM. Adding
paravirt_steal_rq_enabled later will be much easier as only one
function needs substantial modification.
Juergen
next prev parent reply other threads:[~2016-05-18 16:00 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-18 12:15 [PATCH] xen: add steal_clock support on x86 Juergen Gross
2016-05-18 14:46 ` Boris Ostrovsky
2016-05-18 14:53 ` Juergen Gross
2016-05-18 15:25 ` Boris Ostrovsky
2016-05-18 15:42 ` Juergen Gross
2016-05-18 15:45 ` David Vrabel
2016-05-18 15:51 ` Juergen Gross
2016-05-18 15:52 ` David Vrabel
2016-05-18 15:53 ` Boris Ostrovsky
2016-05-18 16:00 ` Juergen Gross [this message]
2016-05-18 16:13 ` Boris Ostrovsky
2016-05-19 5:33 ` Juergen Gross
2016-05-18 16:10 ` [Xen-devel] " Dario Faggioli
2016-05-18 17:20 ` Boris Ostrovsky
2016-05-18 17:59 ` Tony S
2016-05-18 18:03 ` Tony S
2016-05-19 3:36 ` Dario Faggioli
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=573C9188.7010303@suse.com \
--to=jgross@suse.com \
--cc=boris.ostrovsky@oracle.com \
--cc=david.vrabel@citrix.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sstabellini@kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox