From: Glauber Costa <glommer@redhat.com>
To: Avi Kivity <avi@redhat.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] keep guest wallclock in sync with host clock
Date: Wed, 2 Sep 2009 09:21:44 -0300 [thread overview]
Message-ID: <20090902122144.GL30340@mothafucka.localdomain> (raw)
In-Reply-To: <4A9E5A8B.4060804@redhat.com>
On Wed, Sep 02, 2009 at 02:44:11PM +0300, Avi Kivity wrote:
> On 09/01/2009 02:50 PM, Glauber Costa wrote:
>> KVM clock is great to avoid drifting in guest VMs running ontop of kvm.
>> However, the current mechanism will not propagate changes in wallclock value
>> upwards. This effectively means that in a large pool of VMs that need accurate timing,
>> all of them has to run NTP, instead of just the host doing it.
>>
>> Since the host updates information in the shared memory area upon msr writes,
>> this patch introduces a worker that writes to that msr, and calls do_settimeofday
>> at fixed intervals, with second resolution. A interval of 0 determines that we
>> are not interested in this behaviour. A later patch will make this optional at
>> runtime
>>
>> +
>> +static void kvm_sync_wall_clock(struct work_struct *work)
>> +{
>> + struct timespec now;
>> +
>> + kvm_get_wall_ts(&now);
>>
>
> What happens if we schedule here?
hummm, I guess disabling preemption would be enough to make us safe here?
>
>> +
>> + do_settimeofday(&now);
>> + schedule_next_update();
>> +}
>> +
>> +static __init int init_updates(void)
>> +{
>> + schedule_next_update();
>> + return 0;
>> +}
>> +/*
>> + * It has to be run after workqueues are initialized, since we call
>> + * schedule_delayed_work. Other than that, we have no specific requirements
>> + */
>> +late_initcall(init_updates);
>>
>
> Should this run on bare metal too?
>
> --
> error compiling committee.c: too many arguments to function
>
next prev parent reply other threads:[~2009-09-02 12:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-01 11:50 [PATCH 0/2] Automatically grab wallclock time updates from hypervisor Glauber Costa
2009-09-01 11:50 ` [PATCH 1/2] keep guest wallclock in sync with host clock Glauber Costa
2009-09-01 11:50 ` [PATCH 2/2] add sysctl for kvm wallclock sync Glauber Costa
2009-09-02 6:54 ` Chris Lalancette
2009-09-02 11:31 ` Glauber Costa
2009-09-02 11:40 ` Avi Kivity
2009-09-02 11:44 ` [PATCH 1/2] keep guest wallclock in sync with host clock Avi Kivity
2009-09-02 12:21 ` Glauber Costa [this message]
2009-09-02 12:24 ` Avi Kivity
2009-09-02 12:48 ` Glauber Costa
2009-09-02 12:56 ` Avi Kivity
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=20090902122144.GL30340@mothafucka.localdomain \
--to=glommer@redhat.com \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®