Re: [PATCH v5 0/6] KVM: x86: get rid of pvclock_gtod_copy

2017-09-11 Thread Denis Plotnikov
ping! On 30.08.2017 18:23, Denis Plotnikov wrote: V5: It was decided to split the series "make L2's kvm-clock stable, get rid of pvclock_gtod_copy in KVM" into two parts to make the changes finer grained: 1. get rid of pvclock_gtod_copy in KVM 2. make L2's kvm-cl

Re: [PATCH v5 0/6] KVM: x86: get rid of pvclock_gtod_copy

2017-09-11 Thread Denis Plotnikov
ping! On 30.08.2017 18:23, Denis Plotnikov wrote: V5: It was decided to split the series "make L2's kvm-clock stable, get rid of pvclock_gtod_copy in KVM" into two parts to make the changes finer grained: 1. get rid of pvclock_gtod_copy in KVM 2. make L2's kvm-cl

[PATCH v5 2/6] timekeeper: introduce boot field in system_time_snapshot

2017-08-30 Thread Denis Plotnikov
The field keeps monotonic time since boot. The value of boot will be used in KVM for masterclock. This is a part of the work aiming to move to a more simple scheme of masterclock related values calculation in KVM Signed-off-by: Denis Plotnikov <dplotni...@virtuozzo.com> --- include

[PATCH v5 2/6] timekeeper: introduce boot field in system_time_snapshot

2017-08-30 Thread Denis Plotnikov
The field keeps monotonic time since boot. The value of boot will be used in KVM for masterclock. This is a part of the work aiming to move to a more simple scheme of masterclock related values calculation in KVM Signed-off-by: Denis Plotnikov --- include/linux/timekeeping.h | 2 ++ kernel

[PATCH v5 6/6] KVM: x86: remove not used pvclock_gtod_copy

2017-08-30 Thread Denis Plotnikov
be redundant because the current scheme doesn't need to update any shadow timekeeper data structure (pvclock_gtod_copy) every time the timekeeper does changes. The notifier has been left unremoved intentionally and its replacing with something else is the matter of future work. Signed-off-by: Denis Plotnikov

[PATCH v5 6/6] KVM: x86: remove not used pvclock_gtod_copy

2017-08-30 Thread Denis Plotnikov
be redundant because the current scheme doesn't need to update any shadow timekeeper data structure (pvclock_gtod_copy) every time the timekeeper does changes. The notifier has been left unremoved intentionally and its replacing with something else is the matter of future work. Signed-off-by: Denis Plotnikov

[PATCH v5 1/6] timekeeper: introduce extended clocksource reading callback

2017-08-30 Thread Denis Plotnikov
The callback provides extended information about just read clocksource value. It's going to be used in cases when detailed system information needed for further time related values calculation, e.g in KVM masterclock settings calculation. Signed-off-by: Denis Plotnikov <dplotni...@virtuozzo.

[PATCH v5 1/6] timekeeper: introduce extended clocksource reading callback

2017-08-30 Thread Denis Plotnikov
The callback provides extended information about just read clocksource value. It's going to be used in cases when detailed system information needed for further time related values calculation, e.g in KVM masterclock settings calculation. Signed-off-by: Denis Plotnikov --- include/linux

[PATCH v5 3/6] timekeeper: use the extended reading function on snapshot acquiring

2017-08-30 Thread Denis Plotnikov
Signed-off-by: Denis Plotnikov <dplotni...@virtuozzo.com> --- include/linux/timekeeping.h | 3 +++ kernel/time/timekeeping.c | 13 +++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h index 5008e3e..528d088

[PATCH v5 3/6] timekeeper: use the extended reading function on snapshot acquiring

2017-08-30 Thread Denis Plotnikov
Signed-off-by: Denis Plotnikov --- include/linux/timekeeping.h | 3 +++ kernel/time/timekeeping.c | 13 +++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h index 5008e3e..528d088 100644 --- a/include/linux

[PATCH v5 5/6] KVM: x86: switch to masterclock update using timekeeper functionality

2017-08-30 Thread Denis Plotnikov
. Removing the leftovers of the old scheme is the matter of the next patches. Signed-off-by: Denis Plotnikov <dplotni...@virtuozzo.com> --- arch/x86/kvm/x86.c | 26 ++ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm

[PATCH v5 5/6] KVM: x86: switch to masterclock update using timekeeper functionality

2017-08-30 Thread Denis Plotnikov
. Removing the leftovers of the old scheme is the matter of the next patches. Signed-off-by: Denis Plotnikov --- arch/x86/kvm/x86.c | 26 ++ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 05a5e57..0e86729 100644

[PATCH v5 4/6] tsc: implement the extended tsc reading function

2017-08-30 Thread Denis Plotnikov
By doing that, add tsc clocksource to a list of KVM clocksources providing valid cycle values, meaning that KVM can use its masterclock. This is a part of the work aiming to move to a more simple scheme of masterclock related values calculation in KVM. Signed-off-by: Denis Plotnikov <dplo

[PATCH v5 0/6] KVM: x86: get rid of pvclock_gtod_copy

2017-08-30 Thread Denis Plotnikov
, which means making L2 stable when running over stable L1 kvm-clock Denis Plotnikov (6): timekeeper: introduce extended clocksource reading callback timekeeper: introduce boot field in system_time_snapshot timekeeper: use the extended reading function on snapshot acquiring tsc: implem

[PATCH v5 4/6] tsc: implement the extended tsc reading function

2017-08-30 Thread Denis Plotnikov
By doing that, add tsc clocksource to a list of KVM clocksources providing valid cycle values, meaning that KVM can use its masterclock. This is a part of the work aiming to move to a more simple scheme of masterclock related values calculation in KVM. Signed-off-by: Denis Plotnikov --- arch

[PATCH v5 0/6] KVM: x86: get rid of pvclock_gtod_copy

2017-08-30 Thread Denis Plotnikov
, which means making L2 stable when running over stable L1 kvm-clock Denis Plotnikov (6): timekeeper: introduce extended clocksource reading callback timekeeper: introduce boot field in system_time_snapshot timekeeper: use the extended reading function on snapshot acquiring tsc: implem

Re: [PATCH v4 00/10] make L2's kvm-clock stable, get rid of pvclock_gtod_copy in KVM

2017-08-28 Thread Denis Plotnikov
On 24.08.2017 11:00, Paolo Bonzini wrote: On 23/08/2017 18:02, Paolo Bonzini wrote: More duct tape would have been just: - if (pvclock_gtod_data.clock.vclock_mode != VCLOCK_TSC) + mode = READ_ONCE(pvclock_gtod_data.clock.vclock_mode); + if (mode != VCLOCK_TSC && +

Re: [PATCH v4 00/10] make L2's kvm-clock stable, get rid of pvclock_gtod_copy in KVM

2017-08-28 Thread Denis Plotnikov
On 24.08.2017 11:00, Paolo Bonzini wrote: On 23/08/2017 18:02, Paolo Bonzini wrote: More duct tape would have been just: - if (pvclock_gtod_data.clock.vclock_mode != VCLOCK_TSC) + mode = READ_ONCE(pvclock_gtod_data.clock.vclock_mode); + if (mode != VCLOCK_TSC && +

Re: [PATCH v4 00/10] make L2's kvm-clock stable, get rid of pvclock_gtod_copy in KVM

2017-08-21 Thread Denis Plotnikov
ping! On 02.08.2017 20:11, Paolo Bonzini wrote: On 02/08/2017 18:49, John Stultz wrote: On Wed, Aug 2, 2017 at 7:38 AM, Denis Plotnikov <dplotni...@virtuozzo.com> wrote: V4: * removed "is stable" function with vague definition of stability there is the only function

Re: [PATCH v4 00/10] make L2's kvm-clock stable, get rid of pvclock_gtod_copy in KVM

2017-08-21 Thread Denis Plotnikov
ping! On 02.08.2017 20:11, Paolo Bonzini wrote: On 02/08/2017 18:49, John Stultz wrote: On Wed, Aug 2, 2017 at 7:38 AM, Denis Plotnikov wrote: V4: * removed "is stable" function with vague definition of stability there is the only function which does time with cycle sta

[PATCH v4 07/10] KVM: x86: remove not used pvclock_gtod_copy

2017-08-02 Thread Denis Plotnikov
Since, KVM has been switched to getting masterclock related data right from the timekeeper by the previous patches, now we are able to remove all the parts related to the old scheme of getting masterclock data. This patch removes those parts. Signed-off-by: Denis Plotnikov <dplo

[PATCH v4 07/10] KVM: x86: remove not used pvclock_gtod_copy

2017-08-02 Thread Denis Plotnikov
Since, KVM has been switched to getting masterclock related data right from the timekeeper by the previous patches, now we are able to remove all the parts related to the old scheme of getting masterclock data. This patch removes those parts. Signed-off-by: Denis Plotnikov --- arch/x86/include

[PATCH v4 06/10] timekeeper: add clocksource change notifier

2017-08-02 Thread Denis Plotnikov
about critical changes happened in the underlying timekeeper. This is a final related to the timekeeper patch of the work aiming to move to a more simple scheme of masterclock related values calculation in KVM. Signed-off-by: Denis Plotnikov <dplotni...@virtuozzo.com> --- include

[PATCH v4 06/10] timekeeper: add clocksource change notifier

2017-08-02 Thread Denis Plotnikov
about critical changes happened in the underlying timekeeper. This is a final related to the timekeeper patch of the work aiming to move to a more simple scheme of masterclock related values calculation in KVM. Signed-off-by: Denis Plotnikov --- include/linux/cs_notifier.h | 17

[PATCH v4 05/10] KVM: x86: switch to masterclock update using timekeeper functionality

2017-08-02 Thread Denis Plotnikov
. Removing the leftovers of the old scheme is the matter of the next patches. Signed-off-by: Denis Plotnikov <dplotni...@virtuozzo.com> --- arch/x86/kvm/x86.c | 26 ++ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm

[PATCH v4 08/10] pvclock: add parameters to store stamp data in pvclock reading function

2017-08-02 Thread Denis Plotnikov
The parameters is a pointer which is used to store cycles and flags stamp value used for time calulation on pvclock reading. This is a part of the work aiming to make possible to use KVM masterclock in L2 guests (those once running over kvmclock clocksource). Signed-off-by: Denis Plotnikov

[PATCH v4 05/10] KVM: x86: switch to masterclock update using timekeeper functionality

2017-08-02 Thread Denis Plotnikov
. Removing the leftovers of the old scheme is the matter of the next patches. Signed-off-by: Denis Plotnikov --- arch/x86/kvm/x86.c | 26 ++ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 6c97c82..d8ec2ca 100644

[PATCH v4 08/10] pvclock: add parameters to store stamp data in pvclock reading function

2017-08-02 Thread Denis Plotnikov
The parameters is a pointer which is used to store cycles and flags stamp value used for time calulation on pvclock reading. This is a part of the work aiming to make possible to use KVM masterclock in L2 guests (those once running over kvmclock clocksource). Signed-off-by: Denis Plotnikov

[PATCH v4 00/10] make L2's kvm-clock stable, get rid of pvclock_gtod_copy in KVM

2017-08-02 Thread Denis Plotnikov
kvm-clock Denis Plotnikov (10): timekeeper: introduce extended clocksource reading callback timekeeper: introduce boot field in system_time_snapshot timekeeper: use the extended reading function on snapshot acquiring tsc: implement the extended tsc reading function KVM: x86: switch to m

[PATCH v4 00/10] make L2's kvm-clock stable, get rid of pvclock_gtod_copy in KVM

2017-08-02 Thread Denis Plotnikov
kvm-clock Denis Plotnikov (10): timekeeper: introduce extended clocksource reading callback timekeeper: introduce boot field in system_time_snapshot timekeeper: use the extended reading function on snapshot acquiring tsc: implement the extended tsc reading function KVM: x86: switch to m

[PATCH v4 02/10] timekeeper: introduce boot field in system_time_snapshot

2017-08-02 Thread Denis Plotnikov
The field keeps monotonic time since boot. The value of boot will be used in KVM for masterclock. This is a part of the work aiming to move to a more simple scheme of masterclock related values calculation in KVM Signed-off-by: Denis Plotnikov <dplotni...@virtuozzo.com> --- include

[PATCH v4 02/10] timekeeper: introduce boot field in system_time_snapshot

2017-08-02 Thread Denis Plotnikov
The field keeps monotonic time since boot. The value of boot will be used in KVM for masterclock. This is a part of the work aiming to move to a more simple scheme of masterclock related values calculation in KVM Signed-off-by: Denis Plotnikov --- include/linux/timekeeping.h | 2 ++ kernel

[PATCH v4 03/10] timekeeper: use the extended reading function on snapshot acquiring

2017-08-02 Thread Denis Plotnikov
Signed-off-by: Denis Plotnikov <dplotni...@virtuozzo.com> --- include/linux/timekeeping.h | 3 +++ kernel/time/timekeeping.c | 13 +++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h index 5008e3e..528d088

[PATCH v4 03/10] timekeeper: use the extended reading function on snapshot acquiring

2017-08-02 Thread Denis Plotnikov
Signed-off-by: Denis Plotnikov --- include/linux/timekeeping.h | 3 +++ kernel/time/timekeeping.c | 13 +++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h index 5008e3e..528d088 100644 --- a/include/linux

[PATCH v4 09/10] pvclock: add clocksource change notification on changing of tsc stable bit

2017-08-02 Thread Denis Plotnikov
clocksource. Signed-off-by: Denis Plotnikov <dplotni...@virtuozzo.com> --- arch/x86/kernel/pvclock.c | 19 --- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/pvclock.c b/arch/x86/kernel/pvclock.c index bece384..5898f20 100644 --- a/arch/x86/

[PATCH v4 09/10] pvclock: add clocksource change notification on changing of tsc stable bit

2017-08-02 Thread Denis Plotnikov
clocksource. Signed-off-by: Denis Plotnikov --- arch/x86/kernel/pvclock.c | 19 --- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/pvclock.c b/arch/x86/kernel/pvclock.c index bece384..5898f20 100644 --- a/arch/x86/kernel/pvclock.c +++ b/arch/x86/kernel

[PATCH v4 10/10] kvmclock: implement the extended reading function

2017-08-02 Thread Denis Plotnikov
This allows L2 guests to use masterclock, namely provide KVM with ability to use masterclock while running over kvmclock closksource in the cases when it's possible. This is the final part of the work of teaching KVM to use masterclock when over kvmclock clocksource. Signed-off-by: Denis

[PATCH v4 10/10] kvmclock: implement the extended reading function

2017-08-02 Thread Denis Plotnikov
This allows L2 guests to use masterclock, namely provide KVM with ability to use masterclock while running over kvmclock closksource in the cases when it's possible. This is the final part of the work of teaching KVM to use masterclock when over kvmclock clocksource. Signed-off-by: Denis

[PATCH v4 01/10] timekeeper: introduce extended clocksource reading callback

2017-08-02 Thread Denis Plotnikov
The callback provides extended information about just read clocksource value. It's going to be used in cases when detailed system information needed for further time related values calculation, e.g in KVM masterclock settings calculation. Signed-off-by: Denis Plotnikov <dplotni...@virtuozzo.

[PATCH v4 01/10] timekeeper: introduce extended clocksource reading callback

2017-08-02 Thread Denis Plotnikov
The callback provides extended information about just read clocksource value. It's going to be used in cases when detailed system information needed for further time related values calculation, e.g in KVM masterclock settings calculation. Signed-off-by: Denis Plotnikov --- include/linux

[PATCH v4 04/10] tsc: implement the extended tsc reading function

2017-08-02 Thread Denis Plotnikov
By doing that, add tsc clocksource to a list of KVM clocksources providing valid cycle values, meaning that KVM can use its masterclock. This is a part of the work aiming to move to a more simple scheme of masterclock related values calculation in KVM. Signed-off-by: Denis Plotnikov <dplo

[PATCH v4 04/10] tsc: implement the extended tsc reading function

2017-08-02 Thread Denis Plotnikov
By doing that, add tsc clocksource to a list of KVM clocksources providing valid cycle values, meaning that KVM can use its masterclock. This is a part of the work aiming to move to a more simple scheme of masterclock related values calculation in KVM. Signed-off-by: Denis Plotnikov --- arch

Re: [RFC PATCH v3 0/6] KVM: x86: avoid redundant REQ_EVENT

2016-12-19 Thread Denis Plotnikov
On 19.12.2016 12:47, Paolo Bonzini wrote: This is the result of cleaning up the places that set REQ_EVENT unnecessarily. The savings on self-IPI kvm-unit-tests are: self_ipi_sti_nop~300 clock cycles self_ipi_sti_hlt~300 clock cycles self_ipi_tpr

Re: [RFC PATCH v3 0/6] KVM: x86: avoid redundant REQ_EVENT

2016-12-19 Thread Denis Plotnikov
On 19.12.2016 12:47, Paolo Bonzini wrote: This is the result of cleaning up the places that set REQ_EVENT unnecessarily. The savings on self-IPI kvm-unit-tests are: self_ipi_sti_nop~300 clock cycles self_ipi_sti_hlt~300 clock cycles self_ipi_tpr

[PATCH v2] KVM: x86: avoid redundant REQ_EVENT

2016-12-14 Thread Denis Plotnikov
to apic_update_ppr to make sure the supression of KVM_REQ_EVENT is done in the KVM_REQ_EVENT processing path only. This microoptimization gives 10% performance increase on a synthetic test doing a lot of IPC in Windows using window messages. Reviewed-by: Roman Kagan <rka...@virtuozzo.com> Signed-off-by:

[PATCH v2] KVM: x86: avoid redundant REQ_EVENT

2016-12-14 Thread Denis Plotnikov
to apic_update_ppr to make sure the supression of KVM_REQ_EVENT is done in the KVM_REQ_EVENT processing path only. This microoptimization gives 10% performance increase on a synthetic test doing a lot of IPC in Windows using window messages. Reviewed-by: Roman Kagan Signed-off-by: Denis Plotnikov --- arch

[PATCH v1] KVM: x86: avoid redundant REQ_EVENT

2016-12-12 Thread Denis Plotnikov
a lot of IPC in Windows using window messages. Reviewed-by: Roman Kagan <rka...@virtuozzo.com> Signed-off-by: Denis Plotnikov <dplotni...@virtuozzo.com> --- arch/x86/kvm/lapic.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/x86/kvm/la

[PATCH v1] KVM: x86: avoid redundant REQ_EVENT

2016-12-12 Thread Denis Plotnikov
a lot of IPC in Windows using window messages. Reviewed-by: Roman Kagan Signed-off-by: Denis Plotnikov --- arch/x86/kvm/lapic.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index 6f69340..b3025d8 100644