Re: [PATCH 05/16] KVM-HDR: Implement wallclock over KVM - KVM Virtual Memory

2011-01-26 Thread Glauber Costa
On Wed, 2011-01-26 at 13:13 +0200, Avi Kivity wrote: On 01/24/2011 08:06 PM, Glauber Costa wrote: As a proof of concept to KVM - Kernel Virtual Memory, this patch implements wallclock grabbing on top of it. At first, it may seem as a waste of work to just redo it, since it is working well

Re: [PATCH 03/16] KVM-HDR: KVM Userspace registering ioctl

2011-01-26 Thread Glauber Costa
On Wed, 2011-01-26 at 17:14 +0200, Avi Kivity wrote: On 01/26/2011 02:14 PM, Glauber Costa wrote: On Wed, 2011-01-26 at 13:12 +0200, Avi Kivity wrote: On 01/24/2011 08:06 PM, Glauber Costa wrote: KVM, which stands for KVM Virtual Memory (I wanted to call it KVM Virtual Mojito

Re: [PATCH 01/16] KVM-HDR: register KVM basic header infrastructure

2011-01-26 Thread Glauber Costa
On Wed, 2011-01-26 at 17:12 +0200, Avi Kivity wrote: On 01/26/2011 02:13 PM, Glauber Costa wrote: - it doesn't lend itself will to live migration. Extra state must be maintained in the hypervisor. Yes, but can be queried at any time as well. I don't do it in this patch

Re: [PATCH 16/16] KVM-GST: adjust scheduler cpu power

2011-01-26 Thread Glauber Costa
On Wed, 2011-01-26 at 10:57 +0100, Peter Zijlstra wrote: On Tue, 2011-01-25 at 19:27 -0200, Glauber Costa wrote: On Tue, 2011-01-25 at 22:07 +0100, Peter Zijlstra wrote: On Tue, 2011-01-25 at 18:47 -0200, Glauber Costa wrote: On Tue, 2011-01-25 at 21:13 +0100, Peter Zijlstra wrote

Re: [PATCH 05/16] KVM-HDR: Implement wallclock over KVM - KVM Virtual Memory

2011-01-26 Thread Glauber Costa
On Wed, 2011-01-26 at 17:17 +0200, Avi Kivity wrote: On 01/26/2011 02:20 PM, Glauber Costa wrote: On Wed, 2011-01-26 at 13:13 +0200, Avi Kivity wrote: On 01/24/2011 08:06 PM, Glauber Costa wrote: As a proof of concept to KVM - Kernel Virtual Memory, this patch implements

Re: [PATCH 16/16] KVM-GST: adjust scheduler cpu power

2011-01-26 Thread Glauber Costa
On Wed, 2011-01-26 at 17:46 +0100, Peter Zijlstra wrote: On Wed, 2011-01-26 at 13:43 -0200, Glauber Costa wrote: yes, but once this delta is subtracted from rq-clock_task, this value is not used to dictate power, unless I am mistaken. power is adjusted according to scale_rt_power

Re: [PATCH 16/16] KVM-GST: adjust scheduler cpu power

2011-01-25 Thread Glauber Costa
On Mon, 2011-01-24 at 20:51 +0100, Peter Zijlstra wrote: On Mon, 2011-01-24 at 16:51 -0200, Glauber Costa wrote: I would really much rather see you change update_rq_clock_task() and subtract your ns resolution steal time from our wall-time, update_rq_clock_task() already updates

Re: [PATCH 16/16] KVM-GST: adjust scheduler cpu power

2011-01-25 Thread Glauber Costa
On Tue, 2011-01-25 at 21:13 +0100, Peter Zijlstra wrote: On Tue, 2011-01-25 at 18:02 -0200, Glauber Costa wrote: I fail to see how does clock_task influence cpu power. If we also have to touch clock_task for better accounting of other stuff, it is a separate story. But for cpu_power, I

Re: [PATCH 16/16] KVM-GST: adjust scheduler cpu power

2011-01-25 Thread Glauber Costa
On Tue, 2011-01-25 at 22:07 +0100, Peter Zijlstra wrote: On Tue, 2011-01-25 at 18:47 -0200, Glauber Costa wrote: On Tue, 2011-01-25 at 21:13 +0100, Peter Zijlstra wrote: On Tue, 2011-01-25 at 18:02 -0200, Glauber Costa wrote: I fail to see how does clock_task influence cpu power

[PATCH 08/16] KVM-HDR: Implement kvmclock systemtime over KVM - KVM Virtual Memory

2011-01-24 Thread Glauber Costa
backports to people who wants to backport the kernel part but not the hypervisor, or the other way around. Signed-off-by: Glauber Costa glom...@redhat.com CC: Avi Kivity a...@redhat.com --- arch/x86/include/asm/kvm_para.h |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/x86

[PATCH 06/16] KVM-HDR: Implement wallclock over KVM - KVM Virtual Memory

2011-01-24 Thread Glauber Costa
to facilitate backports to people who wants to backport the kernel part but not the hypervisor, or the other way around. Signed-off-by: Glauber Costa glom...@redhat.com CC: Avi Kivity a...@redhat.com --- arch/x86/kvm/x86.c | 10 ++ 1 files changed, 10 insertions(+), 0 deletions(-) diff

[PATCH 10/16] KVM-GST: Implement kvmclock systemtime over KVM - KVM Virtual Memory

2011-01-24 Thread Glauber Costa
backports to people who wants to backport the kernel part but not the hypervisor, or the other way around. Signed-off-by: Glauber Costa glom...@redhat.com CC: Avi Kivity a...@redhat.com --- arch/x86/kernel/kvmclock.c | 31 ++- 1 files changed, 22 insertions(+), 9

[PATCH 14/16] KVM-GST: KVM Steal time registration

2011-01-24 Thread Glauber Costa
Register steal time within KVM. Everytime we sample the steal time information, we update a local variable that tells what was the last time read. We then account the difference. Signed-off-by: Glauber Costa glom...@redhat.com CC: Rik van Riel r...@redhat.com CC: Jeremy Fitzhardinge

[PATCH 12/16] KVM-HV: KVM Steal time implementation

2011-01-24 Thread Glauber Costa
keeping it separate from the headers to facilitate backports to people who wants to backport the kernel part but not the hypervisor, or the other way around. Signed-off-by: Glauber Costa glom...@redhat.com CC: Rik van Riel r...@redhat.com CC: Jeremy Fitzhardinge jeremy.fitzhardi...@citrix.com CC

[PATCH 13/16] KVM-HV: KVM Steal time calculation

2011-01-24 Thread Glauber Costa
. If this is, or if this will not, be accounted as steal time for the guest, is a guest's decision. Signed-off-by: Glauber Costa glom...@redhat.com CC: Rik van Riel r...@redhat.com CC: Jeremy Fitzhardinge jeremy.fitzhardi...@citrix.com CC: Peter Zijlstra pet...@infradead.org CC: Avi Kivity a...@redhat.com --- arch/x86/include/asm

[PATCH 04/16] KVM-HV: KVM Userspace registering ioctl

2011-01-24 Thread Glauber Costa
keeping it separate from the headers to facilitate backports to people who wants to backport the kernel part but not the hypervisor, or the other way around. Signed-off-by: Glauber Costa glom...@redhat.com CC: Rik van Riel r...@redhat.com CC: Jeremy Fitzhardinge jeremy.fitzhardi...@citrix.com CC: Peter

[PATCH 15/16] KVM-GST: KVM Steal time accounting

2011-01-24 Thread Glauber Costa
() can be called from multiple places, not only account_process_tick(), steal time grabbing is repeated in each account function separatedely. Signed-off-by: Glauber Costa glom...@redhat.com CC: Rik van Riel r...@redhat.com CC: Jeremy Fitzhardinge jeremy.fitzhardi...@citrix.com CC: Peter Zijlstra pet

[PATCH 01/16] KVM-HDR: register KVM basic header infrastructure

2011-01-24 Thread Glauber Costa
, or the other way around. Signed-off-by: Glauber Costa glom...@redhat.com CC: Avi Kivity a...@redhat.com --- arch/x86/include/asm/kvm_para.h | 11 +++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/arch/x86/include/asm/kvm_para.h b/arch/x86/include/asm/kvm_para.h index a427bf7

[PATCH 00/16] New Proposal for steal time in KVM

2011-01-24 Thread Glauber Costa
early work, and advise on that - including Stop now, you idiot! is very welcome. TODO: * Handle unregister over reboots * Grab a list of current registrations, for migration * Write documentation * Check size in hv registerings, to prevent out of boundaries exploits Glauber Costa (16

[PATCH 07/16] KVM-GST: Implement wallclock over KVM - KVM Virtual Memory

2011-01-24 Thread Glauber Costa
to facilitate backports to people who wants to backport the kernel part but not the hypervisor, or the other way around. Signed-off-by: Glauber Costa glom...@redhat.com CC: Avi Kivity a...@redhat.com --- arch/x86/kernel/kvmclock.c | 41 - 1 files changed, 36

[PATCH 11/16] KVM-HDR: KVM Steal time implementation

2011-01-24 Thread Glauber Costa
it separate to facilitate backports to people who wants to backport the kernel part but not the hypervisor, or the other way around. Signed-off-by: Glauber Costa glom...@redhat.com CC: Rik van Riel r...@redhat.com CC: Jeremy Fitzhardinge jeremy.fitzhardi...@citrix.com CC: Peter Zijlstra pet

[PATCH 09/16] KVM-HV: Implement kvmclock systemtime over KVM - KVM Virtual Memory

2011-01-24 Thread Glauber Costa
the headers to facilitate backports to people who wants to backport the kernel part but not the hypervisor, or the other way around. Signed-off-by: Glauber Costa glom...@redhat.com CC: Avi Kivity a...@redhat.com --- arch/x86/kvm/x86.c | 55 +++ 1 files

[PATCH 05/16] KVM-HDR: Implement wallclock over KVM - KVM Virtual Memory

2011-01-24 Thread Glauber Costa
who wants to backport the kernel part but not the hypervisor, or the other way around. Signed-off-by: Glauber Costa glom...@redhat.com CC: Avi Kivity a...@redhat.com --- arch/x86/include/asm/kvm_para.h |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/x86/include/asm

[PATCH 03/16] KVM-HDR: KVM Userspace registering ioctl

2011-01-24 Thread Glauber Costa
keeping the headers separate to facilitate backports to people who wants to backport the kernel part but not the hypervisor, or the other way around. Signed-off-by: Glauber Costa glom...@redhat.com CC: Avi Kivity a...@redhat.com --- include/linux/kvm.h | 14 +- include/linux

Re: [PATCH 16/16] KVM-GST: adjust scheduler cpu power

2011-01-24 Thread Glauber Costa
On Mon, 2011-01-24 at 19:32 +0100, Peter Zijlstra wrote: On Mon, 2011-01-24 at 13:06 -0500, Glauber Costa wrote: This is a first proposal for using steal time information to influence the scheduler. There are a lot of optimizations and fine grained adjustments to be done, but it is working

Re: [PATCH 16/16] KVM-GST: adjust scheduler cpu power

2011-01-24 Thread Glauber Costa
On Mon, 2011-01-24 at 20:51 +0100, Peter Zijlstra wrote: On Mon, 2011-01-24 at 16:51 -0200, Glauber Costa wrote: I would really much rather see you change update_rq_clock_task() and subtract your ns resolution steal time from our wall-time, update_rq_clock_task() already updates

Re: [PATCH 14/16] KVM-GST: KVM Steal time registration

2011-01-24 Thread Glauber Costa
On Mon, 2011-01-24 at 18:31 -0500, Rik van Riel wrote: On 01/24/2011 01:06 PM, Glauber Costa wrote: Register steal time within KVM. Everytime we sample the steal time information, we update a local variable that tells what was the last time read. We then account the difference. Signed

Re: [PATCH 14/16] KVM-GST: KVM Steal time registration

2011-01-24 Thread Glauber Costa
On Mon, 2011-01-24 at 20:26 -0500, Rik van Riel wrote: On 01/24/2011 08:25 PM, Glauber Costa wrote: On Mon, 2011-01-24 at 18:31 -0500, Rik van Riel wrote: On 01/24/2011 01:06 PM, Glauber Costa wrote: Register steal time within KVM. Everytime we sample the steal time information, we update

Re: [PATCH v3 11/21] kvm: x86: Reset paravirtual MSRs

2011-01-04 Thread Glauber Costa
-by: Jan Kiszka jan.kis...@siemens.com CC: Glauber Costa glom...@redhat.com looks good. target-i386/kvm.c |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/target-i386/kvm.c b/target-i386/kvm.c index d8f26bf..8267655 100644 --- a/target-i386/kvm.c +++ b/target

Re: [PATCH v3 15/21] kvm: x86: Introduce kvmclock device to save/restore its state

2011-01-04 Thread Glauber Costa
On Tue, 2011-01-04 at 09:32 +0100, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com If kvmclock is used, which implies the kernel supports it, register a kvmclock device with the sysbus. Its main purpose is to save and restore the kernel state on migration, but this will also allow

Re: [PATCH v3 15/21] kvm: x86: Introduce kvmclock device to save/restore its state

2011-01-04 Thread Glauber Costa
On Tue, 2011-01-04 at 12:34 +0100, Jan Kiszka wrote: Am 04.01.2011 12:08, Glauber Costa wrote: On Tue, 2011-01-04 at 09:32 +0100, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com If kvmclock is used, which implies the kernel supports it, register a kvmclock device

Re: [PATCH v3 15/21] kvm: x86: Introduce kvmclock device to save/restore its state

2011-01-04 Thread Glauber Costa
On Tue, 2011-01-04 at 12:45 +0100, Jan Kiszka wrote: Am 04.01.2011 12:43, Glauber Costa wrote: On Tue, 2011-01-04 at 12:34 +0100, Jan Kiszka wrote: Am 04.01.2011 12:08, Glauber Costa wrote: On Tue, 2011-01-04 at 09:32 +0100, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com

Re: [PATCH v2 14/17] kvm: x86: Introduce kvmclock device to save/restore its state

2011-01-03 Thread Glauber Costa
to visualize it one day. Signed-off-by: Jan Kiszka jan.kis...@siemens.com CC: Glauber Costa glom...@redhat.com Hi Jan. I've just recently posted a patch (not sure what was made from it), that fixes a bug that you reintroduce here. The bug is: if we call KVM_GET_CLOCK ioctl in pre_save

Re: [PATCH v2 14/17] kvm: x86: Introduce kvmclock device to save/restore its state

2011-01-03 Thread Glauber Costa
On Mon, 2011-01-03 at 18:04 +0200, Avi Kivity wrote: On 01/03/2011 10:33 AM, Jan Kiszka wrote: From: Jan Kiszkajan.kis...@siemens.com If kvmclock is used, which implies the kernel supports it, register a kvmclock device with the sysbus. Its main purpose is to save and restore the kernel

Re: [PATCH v2 14/17] kvm: x86: Introduce kvmclock device to save/restore its state

2011-01-03 Thread Glauber Costa
On Mon, 2011-01-03 at 17:30 +0100, Jan Kiszka wrote: Am 03.01.2011 17:04, Avi Kivity wrote: On 01/03/2011 10:33 AM, Jan Kiszka wrote: From: Jan Kiszkajan.kis...@siemens.com If kvmclock is used, which implies the kernel supports it, register a kvmclock device with the sysbus. Its main

Re: [PATCH v2 11/17] kvm: x86: Reset paravirtual MSRs

2011-01-03 Thread Glauber Costa
...@siemens.com CC: Glauber Costa glom...@redhat.com --- target-i386/kvm.c | 10 ++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/target-i386/kvm.c b/target-i386/kvm.c index d8f26bf..664a4a0 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -453,6 +453,9 @@ void

Re: [PATCH] KVM: pvclock_clocksource_read while-loop optimization

2011-01-03 Thread Glauber Costa
On Sat, 2011-01-01 at 21:51 +0100, Arjan Koers wrote: Reduce the number of while-loop iterations (from two to one in the most common situation) Signed-off-by: Arjan Koers 0h61vkll2...@xutrox.com diff --git a/arch/x86/kernel/pvclock.c b/arch/x86/kernel/pvclock.c index 42eb330..8f52acb

Re: [PATCH v2 11/17] kvm: x86: Reset paravirtual MSRs

2011-01-03 Thread Glauber Costa
On Mon, 2011-01-03 at 17:46 +0100, Jan Kiszka wrote: Am 03.01.2011 17:40, Glauber Costa wrote: On Mon, 2011-01-03 at 09:33 +0100, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com Make sure to clear MSR_KVM_SYSTEM_TIME, MSR_KVM_WALL_CLOCK, and MSR_KVM_ASYNC_PF_EN so

Re: [COMMIT master] KVM guest: Fix kvm clock initialization when it's configured out

2010-12-20 Thread Glauber Costa
On Sun, Dec 19, 2010 at 1:50 PM, Avi Kivity a...@redhat.com wrote: From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com Avi, I recently sent a patch that handles a case much similar to this: when kvmclock is compiled in the guest, but not enabled in the host. It somehow

Re: [RFC 0/4] KVM in-kernel PM Timer implementation

2010-12-14 Thread Glauber Costa
On Tue, 2010-12-14 at 15:34 +0200, Avi Kivity wrote: On 12/14/2010 02:09 PM, Ulrich Obergfell wrote: Hi, This is an RFC through which I would like to get feedback on how the idea of in-kernel PM Timer would be received. The current implementation of PM Timer emulation is

Re: [PATCH v2 1/2] Do not register kvmclock savevm section if kvmclock is disabled.

2010-12-13 Thread Glauber Costa
On Wed, 2010-12-08 at 17:31 -0200, Marcelo Tosatti wrote: On Tue, Dec 07, 2010 at 03:12:36PM -0200, Glauber Costa wrote: On Mon, 2010-12-06 at 19:04 -0200, Marcelo Tosatti wrote: On Mon, Dec 06, 2010 at 09:03:46AM -0500, Glauber Costa wrote: Usually nobody usually thinks about

Re: [PATCH v2 1/2] Do not register kvmclock savevm section if kvmclock is disabled.

2010-12-07 Thread Glauber Costa
On Mon, 2010-12-06 at 19:04 -0200, Marcelo Tosatti wrote: On Mon, Dec 06, 2010 at 09:03:46AM -0500, Glauber Costa wrote: Usually nobody usually thinks about that scenario (me included and specially), but kvmclock can be actually disabled in the host. It happens in two scenarios: 1

[PATCH v2 0/2] savevm odness related to kvmclock

2010-12-06 Thread Glauber Costa
it only if it's enabled at machine start. v2: improvements suggested by Paolo, and patch reordering. Glauber Costa (2): Do not register kvmclock savevm section if kvmclock is disabled. make kvmclock value idempotent for stopped machine cpus.c|3 +++ qemu-kvm-x86.c| 23

[PATCH v2 2/2] make kvmclock value idempotent for stopped machine

2010-12-06 Thread Glauber Costa
more times, but this should be fine since vm_stop is not a hot path. When we do migrate, we'll transfer that value along. Signed-off-by: Glauber Costa glom...@redhat.com CC: Paolo Bonzini pbonz...@redhat.com --- qemu-kvm-x86.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff

[PATCH v2 1/2] Do not register kvmclock savevm section if kvmclock is disabled.

2010-12-06 Thread Glauber Costa
. This patch achives that by registering this section only if kvmclock is actually currently enabled in cpuid. The only caveat is that we have to register the savevm section a little bit later, since we won't know the final kvmclock state before cpuid gets parsed. Signed-off-by: Glauber Costa glom

[PATCH] do not try to register kvmclock if the host does not support it.

2010-12-03 Thread Glauber Costa
kvm_register_clock, re-using the kvmclock-enabled parameter for that. This fixes this specific bug, and should protect us from similar changes in the future. Signed-off-by: Glauber Costa glom...@redhat.com --- arch/x86/kernel/kvmclock.c | 12 ++-- 1 files changed, 10 insertions(+), 2 deletions

[PATCH 1/2] make kvmclock value idempotent for stopped machine

2010-12-03 Thread Glauber Costa
is not a hot path. When we do migrate, we'll transfer that value along. Signed-off-by: Glauber Costa glom...@redhat.com --- cpus.c |4 qemu-kvm-x86.c |7 ++- qemu-kvm.h |2 ++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/cpus.c b/cpus.c index

[PATCH 0/2] Fix savevm odness related to kvmclock

2010-12-03 Thread Glauber Costa
it only if it's enabled at machine start. Thanks Glauber Costa (2): make kvmclock value idempotent for stopped machine Do not register kvmclock savevm section if kvmclock is disabled. cpus.c|7 +++ qemu-kvm-x86.c| 25 +++-- qemu-kvm.h

[PATCH 2/2] Do not register kvmclock savevm section if kvmclock is disabled.

2010-12-03 Thread Glauber Costa
. This patch achives that by registering this section only if kvmclock is actually currently enabled in cpuid. The only caveat is that we have to register the savevm section a little bit later, since we won't know the final kvmclock state before cpuid gets parsed. Signed-off-by: Glauber Costa glom

Re: linux-next: Tree for November 22 (kvm)

2010-11-30 Thread Glauber Costa
On Mon, 2010-11-29 at 08:08 -1000, Zachary Amsden wrote: On 11/29/2010 07:52 AM, Randy Dunlap wrote: On 11/29/10 09:47, Zachary Amsden wrote: On 11/29/2010 06:35 AM, Avi Kivity wrote: On 11/29/2010 06:33 PM, Randy Dunlap wrote: On Mon, 22 Nov 2010 13:26:27 -0800

Re: [PATCH 1/5] Add a global synchronization point for pvclock

2010-10-26 Thread Glauber Costa
On Tue, 2010-10-26 at 10:14 +0200, Avi Kivity wrote: On 10/26/2010 01:30 AM, Jeremy Fitzhardinge wrote: Unfortunately this is breaking Xen save/restore: if you restore on a host which was booted more recently than the save host, causing the system time to be smaller. The effect is that the

Re: [PATCH] x86/pvclock-xen: zero last_value on resume

2010-10-26 Thread Glauber Costa
On Tue, 2010-10-26 at 09:59 -0700, Jeremy Fitzhardinge wrote: If the guest domain has been suspend/resumed or migrated, then the system clock backing the pvclock clocksource may revert to a smaller value (ie, can be non-monotonic across the migration/save-restore). Make sure we zero

Re: 2.6.35-rc1 regression with pvclock and smp guests

2010-10-13 Thread Glauber Costa
On Mon, Oct 11, 2010 at 10:47:16AM -1000, Zachary Amsden wrote: On 10/08/2010 10:59 PM, Arjan Koers wrote: On 2010-10-09 08:29, Michael Tokarev wrote: ... The result is that no released linux kernel boots in smp in kvm, which is a linux virtual machine. That's irony, isn't it? I wonder

last_kernel_ns ?

2010-10-04 Thread Glauber Costa
Zach, vcpu-hv_clock.tsc_timestamp = tsc_timestamp; vcpu-hv_clock.system_time = kernel_ns + v-kvm-arch.kvmclock_offset; vcpu-last_kernel_ns = kernel_ns; = (1) vcpu-last_guest_tsc = tsc_timestamp; vcpu-hv_clock.flags = 0; If I understand your intention

Re: [ANNOUNCE] qemu-kvm-0.13.0-rc1

2010-09-13 Thread Glauber Costa
On Sun, Sep 12, 2010 at 05:59:45PM +0200, Avi Kivity wrote: On 09/12/2010 05:31 PM, Anthony Liguori wrote: On 09/12/2010 01:11 AM, Avi Kivity wrote: On 09/10/2010 10:48 PM, Anthony Liguori wrote: I agree, is there any reason not to enable compiling less into the binary? There are folks

Re: [RFC v2 4/7] change kernel accounting to include steal time

2010-09-02 Thread Glauber Costa
On Tue, Aug 31, 2010 at 10:11:49AM +0200, Peter Zijlstra wrote: On Mon, 2010-08-30 at 19:03 -0400, Rik van Riel wrote: I think it basically comes down to adding sched_clock_unstolen() which the scheduler can use to measure time a process spends running, and sched_clock() for measuring

Re: [RFC 4/7] change kernel accounting to include steal time

2010-08-30 Thread Glauber Costa
On Sun, Aug 29, 2010 at 12:59:36PM +0300, Avi Kivity wrote: On 08/26/2010 12:43 AM, Glauber Costa wrote: This patch proposes a common steal time implementation. When no steal time is accounted, we just add a branch to the current accounting code, that shouldn't add much overhead. When we

Re: [RFC 2/7] change headers preparing for steal time

2010-08-30 Thread Glauber Costa
On Sun, Aug 29, 2010 at 12:51:40PM +0300, Avi Kivity wrote: On 08/26/2010 12:43 AM, Glauber Costa wrote: This guest/host common patch prepares infrastructure for the steal time implementation. Some constants are added, and a name change happens in pvclock vcpu structure. Signed-off

[RFC 1/8] Implement getnsboottime kernel API

2010-08-30 Thread Glauber Costa
From: Zachary Amsden zams...@redhat.com Add a kernel call to get the number of nanoseconds since boot. This is generally useful enough to make it a generic call. Signed-off-by: Zachary Amsden zams...@redhat.com --- include/linux/time.h |1 + kernel/time/timekeeping.c | 27

[RFC v2 1/7] change headers preparing for steal time

2010-08-30 Thread Glauber Costa
This guest/host common patch prepares infrastructure for the steal time implementation. Some constants are added, and a name change happens in pvclock vcpu structure. Signed-off-by: Glauber Costa glom...@redhat.com --- arch/x86/include/asm/kvm_para.h|1 + arch/x86/include/asm/pvclock

[RFC v2 0/7] kvm stael time implementation

2010-08-30 Thread Glauber Costa
of the idea as a whole. Have a nice review. Glauber Costa (7): change headers preparing for steal time always call kvm_write_guest measure time out of guest change kernel accounting to include steal time kvm steal time implementation touch softlockup watchdog tell guest about steal time feature

[RFC v2 3/7] measure time out of guest

2010-08-30 Thread Glauber Costa
By measuring time between a vcpu_put and a vcpu_load, we can estimate how much time did the guest stay out of the cpu. This is exported to the guest at every clock update. Signed-off-by: Glauber Costa glom...@redhat.com --- arch/x86/include/asm/kvm_host.h |2 ++ arch/x86/kvm/x86.c

[RFC v2 2/7] always call kvm_write_guest

2010-08-30 Thread Glauber Costa
This patch makes sure that kvm_write_guest() is called at every guest enter. We do not, however, want to update all the structure at all times, so we add a flag that basically tells it whether or not to do the whole operation Signed-off-by: Glauber Costa glom...@redhat.com --- arch/x86/kvm/x86.c

[RFC v2 4/7] change kernel accounting to include steal time

2010-08-30 Thread Glauber Costa
to the host cpu-hog. A cpu-hog in the host with no load in the guest, produces 0 % steal time, with 100 % idle, as one would expect. Signed-off-by: Glauber Costa glom...@redhat.com --- include/linux/sched.h |1 + kernel/sched.c| 29 + 2 files changed, 30 insertions

[RFC 3/8] always call kvm_write_guest

2010-08-30 Thread Glauber Costa
This patch makes sure that kvm_write_guest() is called at every guest enter. We do not, however, want to update all the structure at all times, so we add a flag that basically tells it whether or not to do the whole operation Signed-off-by: Glauber Costa glom...@redhat.com --- arch/x86/kvm/x86.c

[RFC 6/8] kvm steal time implementation

2010-08-30 Thread Glauber Costa
This is the proposed kvm-side steal time implementation. It is migration safe, as it checks flags at every read. Signed-off-by: Glauber Costa glom...@redhat.com --- arch/x86/kernel/kvmclock.c | 35 +++ 1 files changed, 35 insertions(+), 0 deletions(-) diff

[RFC v2 7/7] tell guest about steal time feature

2010-08-30 Thread Glauber Costa
Guest kernel will only activate steal time if the host exports it. Warn the guest about it. --- arch/x86/kvm/x86.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 9d08032..f6a2d74 100644 --- a/arch/x86/kvm/x86.c +++

[RFC 5/8] change kernel accounting to include steal time

2010-08-30 Thread Glauber Costa
to the host cpu-hog. A cpu-hog in the host with no load in the guest, produces 0 % steal time, with 100 % idle, as one would expect. Signed-off-by: Glauber Costa glom...@redhat.com --- include/linux/sched.h |1 + kernel/sched.c| 29 + 2 files changed, 30 insertions

[RFC 2/8] change headers preparing for steal time

2010-08-30 Thread Glauber Costa
This guest/host common patch prepares infrastructure for the steal time implementation. Some constants are added, and a name change happens in pvclock vcpu structure. Signed-off-by: Glauber Costa glom...@redhat.com --- arch/x86/include/asm/kvm_para.h|1 + arch/x86/include/asm/pvclock

[RFC v2 6/7] touch softlockup watchdog

2010-08-30 Thread Glauber Costa
With a reliable steal time mechanism, we can tell if we're out of the cpu for very long, differentiating from the case that we simply got a real softlockup. In the case we were out of cpu, the watchdog is fed, making bogus softlockups disappear. Signed-off-by: Glauber Costa glom...@redhat.com

[RFC 7/8] touch softlockup watchdog

2010-08-30 Thread Glauber Costa
With a reliable steal time mechanism, we can tell if we're out of the cpu for very long, differentiating from the case that we simply got a real softlockup. In the case we were out of cpu, the watchdog is fed, making bogus softlockups disappear. Signed-off-by: Glauber Costa glom...@redhat.com

[RFC 8/8] tell guest about steal time feature

2010-08-30 Thread Glauber Costa
Guest kernel will only activate steal time if the host exports it. Warn the guest about it. --- arch/x86/kvm/x86.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 9d08032..f6a2d74 100644 --- a/arch/x86/kvm/x86.c +++

[RFC v2 5/7] kvm steal time implementation

2010-08-30 Thread Glauber Costa
This is the proposed kvm-side steal time implementation. It is migration safe, as it checks flags at every read. Signed-off-by: Glauber Costa glom...@redhat.com --- arch/x86/kernel/kvmclock.c | 35 +++ 1 files changed, 35 insertions(+), 0 deletions(-) diff

[RFC 4/8] measure time out of guest

2010-08-30 Thread Glauber Costa
By measuring time between a vcpu_put and a vcpu_load, we can estimate how much time did the guest stay out of the cpu. This is exported to the guest at every clock update. Signed-off-by: Glauber Costa glom...@redhat.com --- arch/x86/include/asm/kvm_host.h |2 ++ arch/x86/kvm/x86.c

Re: [RFC v2 0/7] kvm stael time implementation

2010-08-30 Thread Glauber Costa
On Mon, Aug 30, 2010 at 09:45:41AM -0700, Jeremy Fitzhardinge wrote: On 08/30/2010 09:37 AM, Peter Zijlstra wrote: Something's gone wrong, I've got at least 15 emails in this thread. Also, please try again but now with --no-chain-reply-to, threads nested this deep are useless for

[RFC v2 1/7] change headers preparing for steal time

2010-08-30 Thread Glauber Costa
This guest/host common patch prepares infrastructure for the steal time implementation. Some constants are added, and a name change happens in pvclock vcpu structure. Signed-off-by: Glauber Costa glom...@redhat.com --- arch/x86/include/asm/kvm_para.h|1 + arch/x86/include/asm/pvclock

[RFC v2 2/7] always call kvm_write_guest

2010-08-30 Thread Glauber Costa
This patch makes sure that kvm_write_guest() is called at every guest enter. We do not, however, want to update all the structure at all times, so we add a flag that basically tells it whether or not to do the whole operation Signed-off-by: Glauber Costa glom...@redhat.com --- arch/x86/kvm/x86.c

[RFC v2 5/7] kvm steal time implementation

2010-08-30 Thread Glauber Costa
This is the proposed kvm-side steal time implementation. It is migration safe, as it checks flags at every read. Signed-off-by: Glauber Costa glom...@redhat.com --- arch/x86/kernel/kvmclock.c | 35 +++ 1 files changed, 35 insertions(+), 0 deletions(-) diff

[RFC v2 7/7] tell guest about steal time feature

2010-08-30 Thread Glauber Costa
Guest kernel will only activate steal time if the host exports it. Warn the guest about it. --- arch/x86/kvm/x86.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 9d08032..f6a2d74 100644 --- a/arch/x86/kvm/x86.c +++

[RFC v2 3/7] measure time out of guest

2010-08-30 Thread Glauber Costa
By measuring time between a vcpu_put and a vcpu_load, we can estimate how much time did the guest stay out of the cpu. This is exported to the guest at every clock update. Signed-off-by: Glauber Costa glom...@redhat.com --- arch/x86/include/asm/kvm_host.h |2 ++ arch/x86/kvm/x86.c

[RFC v2 6/7] touch softlockup watchdog

2010-08-30 Thread Glauber Costa
With a reliable steal time mechanism, we can tell if we're out of the cpu for very long, differentiating from the case that we simply got a real softlockup. In the case we were out of cpu, the watchdog is fed, making bogus softlockups disappear. Signed-off-by: Glauber Costa glom...@redhat.com

Re: [RFC 5/8] change kernel accounting to include steal time

2010-08-30 Thread Glauber Costa
On Mon, Aug 30, 2010 at 06:46:25PM +0200, Peter Zijlstra wrote: On Mon, 2010-08-30 at 12:06 -0400, Glauber Costa wrote: This patch proposes a common steal time implementation. When no steal time is accounted, we just add a branch to the current accounting code, that shouldn't add much

Re: [RFC v2 6/7] touch softlockup watchdog

2010-08-30 Thread Glauber Costa
On Mon, Aug 30, 2010 at 10:33:26AM -0700, Jeremy Fitzhardinge wrote: On 08/30/2010 09:06 AM, Glauber Costa wrote: With a reliable steal time mechanism, we can tell if we're out of the cpu for very long, differentiating from the case that we simply got a real softlockup. In the case we

Re: [PATCH kvm-unit-test 6/6] Add a test for kvm-clock

2010-08-27 Thread Glauber Costa
On Fri, Aug 27, 2010 at 01:49:53PM +0800, Jason Wang wrote: This patch implements two tests for kvmclock. First one check whether the date of time returned by kvmclock matches the value got from host. Second one check whether the cycle of kvmclock grows monotonically in smp guest. Three

Re: [PATCH kvm-unit-test 5/6] Add a simple kvmclock driver

2010-08-27 Thread Glauber Costa
On Fri, Aug 27, 2010 at 01:49:45PM +0800, Jason Wang wrote: +#define unlikely(x) __builtin_expect(!!(x), 0) + +struct pvclock_vcpu_time_info hv_clock[MAX_CPU]; this structure have to be 4-byte aligned. Let the compiler help you guaranteeing it here. +#define MAX_CPU 4 + Any particular

Re: [PATCH kvm-unit-test 6/6] Add a test for kvm-clock

2010-08-27 Thread Glauber Costa
On Fri, Aug 27, 2010 at 01:49:53PM +0800, Jason Wang wrote: This patch implements two tests for kvmclock. First one check whether the date of time returned by kvmclock matches the value got from host. Second one check whether the cycle of kvmclock grows monotonically in smp guest. Three

Re: [PATCH kvm-unit-test 2/6] Introduce atomic operations

2010-08-27 Thread Glauber Costa
On Fri, Aug 27, 2010 at 01:49:20PM +0800, Jason Wang wrote: +u64 atomic64_cmpxchg(atomic64_t *v, u64 old, u64 new) +{ +u64 ret; +u64 _old = old; +u64 _new = new; + +asm volatile(lock cmpxchgq %1,%2 + : =a (ret) + : r

Re: [RFC 4/7] change kernel accounting to include steal time

2010-08-26 Thread Glauber Costa
On Thu, Aug 26, 2010 at 05:47:12PM -0300, Marcelo Tosatti wrote: Linux does statistical sampling for accounting anyway, so I don't see it getting much worse. A cpu hog that sleeps 1us every 1ms. Imagine a user program, that at periodic intervals, goes to the system. Under the current

Re: [RFC 2/7] change headers preparing for steal time

2010-08-26 Thread Glauber Costa
On Thu, Aug 26, 2010 at 05:04:02PM -0400, Rik van Riel wrote: On 08/26/2010 04:44 PM, Zachary Amsden wrote: On 08/25/2010 11:43 AM, Glauber Costa wrote: This guest/host common patch prepares infrastructure for the steal time implementation. Some constants are added, and a name change happens

Re: [RFC 4/7] change kernel accounting to include steal time

2010-08-26 Thread Glauber Costa
On Thu, Aug 26, 2010 at 05:19:23PM -0400, Rik van Riel wrote: On 08/25/2010 05:43 PM, Glauber Costa wrote: This patch proposes a common steal time implementation. When no steal time is accounted, we just add a branch to the current accounting code, that shouldn't add much overhead. When we

Re: [RFC 4/7] change kernel accounting to include steal time

2010-08-26 Thread Glauber Costa
On Thu, Aug 26, 2010 at 04:14:47PM -0500, Anthony Liguori wrote: On 08/26/2010 03:28 PM, Glauber Costa wrote: + if (delta 1000UL) + touch_softlockup_watchdog(); + This will break authentic soft lockup detection whenever qemu processing takes more than 1s. This should

Re: [RFC 4/7] change kernel accounting to include steal time

2010-08-26 Thread Glauber Costa
On Thu, Aug 26, 2010 at 08:12:40PM -0300, Marcelo Tosatti wrote: On Thu, Aug 26, 2010 at 06:40:36PM -0300, Glauber Costa wrote: On Thu, Aug 26, 2010 at 04:14:47PM -0500, Anthony Liguori wrote: On 08/26/2010 03:28 PM, Glauber Costa wrote: + if (delta 1000UL

[RFC 0/7] KVM steal time implementation

2010-08-25 Thread Glauber Costa
as a whole. Have a nice review. Glauber Costa (6): change headers preparing for steal time measure time out of guest change kernel accounting to include steal time kvm steal time implementation touch softlockup watchdog tell guest about steal time feature Zachary Amsden (1): Implement

[RFC 1/7] Implement getnsboottime kernel API

2010-08-25 Thread Glauber Costa
From: Zachary Amsden zams...@redhat.com Add a kernel call to get the number of nanoseconds since boot. This is generally useful enough to make it a generic call. Signed-off-by: Zachary Amsden zams...@redhat.com --- include/linux/time.h |1 + kernel/time/timekeeping.c | 27

[RFC 2/7] change headers preparing for steal time

2010-08-25 Thread Glauber Costa
This guest/host common patch prepares infrastructure for the steal time implementation. Some constants are added, and a name change happens in pvclock vcpu structure. Signed-off-by: Glauber Costa glom...@redhat.com --- arch/x86/include/asm/kvm_para.h|1 + arch/x86/include/asm/pvclock

[RFC 3/7] measure time out of guest

2010-08-25 Thread Glauber Costa
By measuring time between a vcpu_put and a vcpu_load, we can estimate how much time did the guest stay out of the cpu. This is exported to the guest at every clock update. Signed-off-by: Glauber Costa glom...@redhat.com --- arch/x86/include/asm/kvm_host.h |2 ++ arch/x86/kvm/x86.c

[RFC 4/7] change kernel accounting to include steal time

2010-08-25 Thread Glauber Costa
to the host cpu-hog. A cpu-hog in the host with no load in the guest, produces 0 % steal time, with 100 % idle, as one would expect. Signed-off-by: Glauber Costa glom...@redhat.com --- include/linux/sched.h |1 + kernel/sched.c| 29 + 2 files changed, 30 insertions

[RFC 5/7] kvm steal time implementation

2010-08-25 Thread Glauber Costa
This is the proposed kvm-side steal time implementation. It is migration safe, as it checks flags at every read. Signed-off-by: Glauber Costa glom...@redhat.com --- arch/x86/kernel/kvmclock.c | 35 +++ 1 files changed, 35 insertions(+), 0 deletions(-) diff

[RFC 7/7] tell guest about steal time feature

2010-08-25 Thread Glauber Costa
Guest kernel will only activate steal time if the host exports it. Warn the guest about it. Signed-off-by: Glauber Costa glom...@redhat.com --- arch/x86/kvm/x86.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 680feaa

[RFC 6/7] touch softlockup watchdog

2010-08-25 Thread Glauber Costa
With a reliable steal time mechanism, we can tell if we're out of the cpu for very long, differentiating from the case that we simply got a real softlockup. In the case we were out of cpu, the watchdog is fed, making bogus softlockups disappear. Signed-off-by: Glauber Costa glom...@redhat.com

<    1   2   3   4   5   6   7   8   9   10   >