All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Vrabel <david.vrabel@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Sheng Yang <sheng@yasker.org>,
	jeremy@goop.org, keir@xen.org, xen-devel@lists.xen.org
Subject: Re: Debian stable kernel got timer issue when running as PV guest
Date: Fri, 13 Apr 2012 17:10:45 +0100	[thread overview]
Message-ID: <4F885005.7090605@citrix.com> (raw)
In-Reply-To: <4F882381020000780007DC4C@nat28.tlf.novell.com>

On 13/04/12 12:00, Jan Beulich wrote:
>>>> On 13.04.12 at 12:37, David Vrabel <dvrabel@cantab.net> wrote:
>> On 13/04/12 08:56, Jan Beulich wrote:
>>>>>> On 12.04.12 at 21:22, Sheng Yang <sheng@yasker.org> wrote:
>>>> I've compiled a kernel, force sched_clock_stable=0, then it solved the
>>>> timestamp jump issue as expected. Luckily, seems it also solved the call
>>>> trace and guest hang issue as well.
>>>
>>> And this is also how it should be fixed.
>>
>> Something like this?  I've not tested it yet as I need to track down
>> some of the problem hardware and get it set up.
> 
> Yeah, except that I'm not sure you really need to clear the feature
> flags. Just making sure sched_clock_stable never gets set should be
> enough; playing with the feature flags always implies that users will
> see bigger differences in /proc/cpuinfo between native and Xen
> kernels...

I have a system with both NONSTOP_TSC and CONSTANT_TSC so
sched_clock_stable should be true.  VMs start and migrate fine with no
unexpected jumps in time.  I think more digging is required here to find
out why time is screwy on this particular system.

David

>> 8<---------------
>> xen: always set the sched clock as unstable
>>
>> It's not clear to me if the Xen clock source can be used as a stable
>> sched clock. Also, even if the guest is started on a system whose
>> underying TSC is stable it may be migrated to one where it's not. So
>> never mark the sched clock as stable.
>>
>> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
>> ---
>>  arch/x86/xen/time.c |    3 +++
>>  1 files changed, 3 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c
>> index 0296a95..b22cd9c 100644
>> --- a/arch/x86/xen/time.c
>> +++ b/arch/x86/xen/time.c
>> @@ -473,6 +473,9 @@ static void __init xen_time_init(void)
>>  	do_settimeofday(&tp);
>>
>>  	setup_force_cpu_cap(X86_FEATURE_TSC);
>> +	setup_clear_cpu_cap(X86_FEATURE_CONSTANT_TSC);
>> +	setup_clear_cpu_cap(X86_FEATURE_NONSTOP_TSC);
>> +	sched_clock_stable = 0;
>>
>>  	xen_setup_runstate_info(cpu);
>>  	xen_setup_timer(cpu);

  reply	other threads:[~2012-04-13 16:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CA+2rt42Z+8Bg9wh=LPphQKBOV6Rxgpm7D8LdKOOq7_X6GVOKxw@mail.gmail.com>
2012-04-12 19:22 ` Debian stable kernel got timer issue when running as PV guest Sheng Yang
2012-04-13  7:56   ` Jan Beulich
2012-04-13 10:37     ` David Vrabel
2012-04-13 11:00       ` Jan Beulich
2012-04-13 16:10         ` David Vrabel [this message]
2012-04-13 16:15           ` Sheng Yang
2012-04-13 17:27     ` Sheng Yang

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=4F885005.7090605@citrix.com \
    --to=david.vrabel@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=jeremy@goop.org \
    --cc=keir@xen.org \
    --cc=sheng@yasker.org \
    --cc=xen-devel@lists.xen.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.