* [PATCH] Replace kvm io delay pv-ops with linux magic
@ 2009-11-18 12:56 Alexander Graf
2009-11-19 22:55 ` Jeremy Fitzhardinge
0 siblings, 1 reply; 7+ messages in thread
From: Alexander Graf @ 2009-11-18 12:56 UTC (permalink / raw)
To: kvm list
Cc: virtualization, Glauber Costa, Avi Kivity, Nick Piggin,
Marcelo Tosatti
Currently we use pv-ops to tell linux not to do anything on io_delay.
While the basic idea is good IMHO, I don't see why we would need pv-ops
for that. The io delay function already has a switch that can do nothing
if you're so inclined.
So here's a patch (stacked on top of the previous pv-ops series) that
removes the io delay pv-ops hook and just sets the native io delay
variable instead.
Signed-off-by: Alexander Graf <agraf@suse.de>
---
arch/x86/Kconfig | 14 --------------
arch/x86/kernel/kvm.c | 16 +++-------------
2 files changed, 3 insertions(+), 27 deletions(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 97d4f92..ebed686 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -527,20 +527,6 @@ config KVM_GUEST
This option enables various optimizations for running under the KVM
hypervisor.
-config KVM_IODELAY
- bool "KVM IO-delay support"
- depends on KVM_GUEST
- select PARAVIRT_CPU
- ---help---
- Usually we wait for PIO access to complete. When inside KVM there's
- no need to do that, as we know that we're not going through a bus,
- but process PIO requests instantly.
-
- This option disables PIO waits, but drags in CPU-bound pv-ops. Thus
- you will probably get more speed loss than speedup using this option.
-
- If in doubt, say N.
-
config KVM_MMU
bool "KVM PV MMU support"
depends on KVM_GUEST
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index 7e0207f..be182e6 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -29,15 +29,6 @@
#include <linux/hardirq.h>
#include <asm/timer.h>
-#ifdef CONFIG_KVM_IODELAY
-/*
- * No need for any "IO delay" on KVM
- */
-static void kvm_io_delay(void)
-{
-}
-#endif /* CONFIG_KVM_IODELAY */
-
#ifdef CONFIG_KVM_MMU
#define MMU_QUEUE_SIZE 1024
@@ -201,13 +192,12 @@ static void kvm_leave_lazy_mmu(void)
static void __init paravirt_ops_setup(void)
{
+ extern int io_delay_type;
pv_info.name = "KVM";
pv_info.paravirt_enabled = 1;
-#ifdef CONFIG_KVM_IODELAY
- if (kvm_para_has_feature(KVM_FEATURE_NOP_IO_DELAY))
- pv_cpu_ops.io_delay = kvm_io_delay;
-#endif
+ /* Disable IO delay */
+ io_delay_type = CONFIG_IO_DELAY_TYPE_NONE;
#ifdef CONFIG_KVM_MMU
if (kvm_para_has_feature(KVM_FEATURE_MMU_OP)) {
--
1.6.0.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] Replace kvm io delay pv-ops with linux magic
2009-11-18 12:56 [PATCH] Replace kvm io delay pv-ops with linux magic Alexander Graf
@ 2009-11-19 22:55 ` Jeremy Fitzhardinge
2009-11-19 23:58 ` Alexander Graf
0 siblings, 1 reply; 7+ messages in thread
From: Jeremy Fitzhardinge @ 2009-11-19 22:55 UTC (permalink / raw)
To: Alexander Graf
Cc: kvm list, Nick Piggin, Glauber Costa, Avi Kivity, virtualization
On 11/18/09 20:56, Alexander Graf wrote:
> Currently we use pv-ops to tell linux not to do anything on io_delay.
>
> While the basic idea is good IMHO, I don't see why we would need pv-ops
> for that. The io delay function already has a switch that can do nothing
> if you're so inclined.
>
> So here's a patch (stacked on top of the previous pv-ops series) that
> removes the io delay pv-ops hook and just sets the native io delay
> variable instead.
>
Can you just get rid of the io_delay op altogether? If KVM doesn't need
it, then nobody does.
J
> Signed-off-by: Alexander Graf <agraf@suse.de>
> ---
> arch/x86/Kconfig | 14 --------------
> arch/x86/kernel/kvm.c | 16 +++-------------
> 2 files changed, 3 insertions(+), 27 deletions(-)
>
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index 97d4f92..ebed686 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -527,20 +527,6 @@ config KVM_GUEST
> This option enables various optimizations for running under the KVM
> hypervisor.
>
> -config KVM_IODELAY
> - bool "KVM IO-delay support"
> - depends on KVM_GUEST
> - select PARAVIRT_CPU
> - ---help---
> - Usually we wait for PIO access to complete. When inside KVM there's
> - no need to do that, as we know that we're not going through a bus,
> - but process PIO requests instantly.
> -
> - This option disables PIO waits, but drags in CPU-bound pv-ops. Thus
> - you will probably get more speed loss than speedup using this option.
> -
> - If in doubt, say N.
> -
> config KVM_MMU
> bool "KVM PV MMU support"
> depends on KVM_GUEST
> diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
> index 7e0207f..be182e6 100644
> --- a/arch/x86/kernel/kvm.c
> +++ b/arch/x86/kernel/kvm.c
> @@ -29,15 +29,6 @@
> #include <linux/hardirq.h>
> #include <asm/timer.h>
>
> -#ifdef CONFIG_KVM_IODELAY
> -/*
> - * No need for any "IO delay" on KVM
> - */
> -static void kvm_io_delay(void)
> -{
> -}
> -#endif /* CONFIG_KVM_IODELAY */
> -
> #ifdef CONFIG_KVM_MMU
> #define MMU_QUEUE_SIZE 1024
>
> @@ -201,13 +192,12 @@ static void kvm_leave_lazy_mmu(void)
>
> static void __init paravirt_ops_setup(void)
> {
> + extern int io_delay_type;
> pv_info.name = "KVM";
> pv_info.paravirt_enabled = 1;
>
> -#ifdef CONFIG_KVM_IODELAY
> - if (kvm_para_has_feature(KVM_FEATURE_NOP_IO_DELAY))
> - pv_cpu_ops.io_delay = kvm_io_delay;
> -#endif
> + /* Disable IO delay */
> + io_delay_type = CONFIG_IO_DELAY_TYPE_NONE;
>
> #ifdef CONFIG_KVM_MMU
> if (kvm_para_has_feature(KVM_FEATURE_MMU_OP)) {
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Replace kvm io delay pv-ops with linux magic
2009-11-19 22:55 ` Jeremy Fitzhardinge
@ 2009-11-19 23:58 ` Alexander Graf
2009-11-20 1:54 ` Jeremy Fitzhardinge
0 siblings, 1 reply; 7+ messages in thread
From: Alexander Graf @ 2009-11-19 23:58 UTC (permalink / raw)
To: Jeremy Fitzhardinge
Cc: kvm list, Nick Piggin, Glauber Costa, Avi Kivity,
virtualization@lists.linux-foundation.org
Am 19.11.2009 um 23:55 schrieb Jeremy Fitzhardinge <jeremy@goop.org>:
> On 11/18/09 20:56, Alexander Graf wrote:
>> Currently we use pv-ops to tell linux not to do anything on io_delay.
>>
>> While the basic idea is good IMHO, I don't see why we would need pv-
>> ops
>> for that. The io delay function already has a switch that can do
>> nothing
>> if you're so inclined.
>>
>> So here's a patch (stacked on top of the previous pv-ops series) that
>> removes the io delay pv-ops hook and just sets the native io delay
>> variable instead.
>>
>
> Can you just get rid of the io_delay op altogether? If KVM doesn't
> need
> it, then nobody does.
Sure, can do. That'd be a separate patch though.
Alex
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Replace kvm io delay pv-ops with linux magic
2009-11-19 23:58 ` Alexander Graf
@ 2009-11-20 1:54 ` Jeremy Fitzhardinge
2009-11-20 1:59 ` Alexander Graf
0 siblings, 1 reply; 7+ messages in thread
From: Jeremy Fitzhardinge @ 2009-11-20 1:54 UTC (permalink / raw)
To: Alexander Graf
Cc: kvm list, Nick Piggin, Glauber Costa, Avi Kivity,
virtualization@lists.linux-foundation.org, Alok Kataria
On 11/20/09 07:58, Alexander Graf wrote:
>
> Am 19.11.2009 um 23:55 schrieb Jeremy Fitzhardinge <jeremy@goop.org>:
>
>> On 11/18/09 20:56, Alexander Graf wrote:
>>> Currently we use pv-ops to tell linux not to do anything on io_delay.
>>>
>>> While the basic idea is good IMHO, I don't see why we would need pv-ops
>>> for that. The io delay function already has a switch that can do
>>> nothing
>>> if you're so inclined.
>>>
>>> So here's a patch (stacked on top of the previous pv-ops series) that
>>> removes the io delay pv-ops hook and just sets the native io delay
>>> variable instead.
>>>
>>
>> Can you just get rid of the io_delay op altogether? If KVM doesn't need
>> it, then nobody does.
>
> Sure, can do. That'd be a separate patch though.
Yep. A patch each for VMI and Xen to remove the dependency, and a final
patch to remove the op. Hm, looks like VMI has a specific ROM call for
io_delay; I wonder what it does.
J
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Replace kvm io delay pv-ops with linux magic
2009-11-20 1:54 ` Jeremy Fitzhardinge
@ 2009-11-20 1:59 ` Alexander Graf
2009-11-20 2:08 ` Jeremy Fitzhardinge
0 siblings, 1 reply; 7+ messages in thread
From: Alexander Graf @ 2009-11-20 1:59 UTC (permalink / raw)
To: Jeremy Fitzhardinge
Cc: kvm list, Nick Piggin, Glauber Costa, Avi Kivity,
virtualization@lists.linux-foundation.org, Alok Kataria
On 20.11.2009, at 02:54, Jeremy Fitzhardinge wrote:
> On 11/20/09 07:58, Alexander Graf wrote:
>>
>> Am 19.11.2009 um 23:55 schrieb Jeremy Fitzhardinge <jeremy@goop.org>:
>>
>>> On 11/18/09 20:56, Alexander Graf wrote:
>>>> Currently we use pv-ops to tell linux not to do anything on
>>>> io_delay.
>>>>
>>>> While the basic idea is good IMHO, I don't see why we would need
>>>> pv-ops
>>>> for that. The io delay function already has a switch that can do
>>>> nothing
>>>> if you're so inclined.
>>>>
>>>> So here's a patch (stacked on top of the previous pv-ops series)
>>>> that
>>>> removes the io delay pv-ops hook and just sets the native io delay
>>>> variable instead.
>>>>
>>>
>>> Can you just get rid of the io_delay op altogether? If KVM
>>> doesn't need
>>> it, then nobody does.
>>
>> Sure, can do. That'd be a separate patch though.
>
> Yep. A patch each for VMI and Xen to remove the dependency, and a
> final
> patch to remove the op. Hm, looks like VMI has a specific ROM call
> for
> io_delay; I wonder what it does.
Oh so it's actually using it? Feel like doing the removal then? I
don't really want to mess with VMI code :-)
Alex
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Replace kvm io delay pv-ops with linux magic
2009-11-20 1:59 ` Alexander Graf
@ 2009-11-20 2:08 ` Jeremy Fitzhardinge
2009-11-20 17:45 ` Alok Kataria
0 siblings, 1 reply; 7+ messages in thread
From: Jeremy Fitzhardinge @ 2009-11-20 2:08 UTC (permalink / raw)
To: Alexander Graf
Cc: kvm list, Nick Piggin, Glauber Costa, Avi Kivity,
virtualization@lists.linux-foundation.org, Alok Kataria
On 11/20/09 09:59, Alexander Graf wrote:
>
> On 20.11.2009, at 02:54, Jeremy Fitzhardinge wrote:
>
>> On 11/20/09 07:58, Alexander Graf wrote:
>>>
>>> Am 19.11.2009 um 23:55 schrieb Jeremy Fitzhardinge <jeremy@goop.org>:
>>>
>>>> On 11/18/09 20:56, Alexander Graf wrote:
>>>>> Currently we use pv-ops to tell linux not to do anything on io_delay.
>>>>>
>>>>> While the basic idea is good IMHO, I don't see why we would need
>>>>> pv-ops
>>>>> for that. The io delay function already has a switch that can do
>>>>> nothing
>>>>> if you're so inclined.
>>>>>
>>>>> So here's a patch (stacked on top of the previous pv-ops series) that
>>>>> removes the io delay pv-ops hook and just sets the native io delay
>>>>> variable instead.
>>>>>
>>>>
>>>> Can you just get rid of the io_delay op altogether? If KVM doesn't
>>>> need
>>>> it, then nobody does.
>>>
>>> Sure, can do. That'd be a separate patch though.
>>
>> Yep. A patch each for VMI and Xen to remove the dependency, and a final
>> patch to remove the op. Hm, looks like VMI has a specific ROM call for
>> io_delay; I wonder what it does.
>
> Oh so it's actually using it? Feel like doing the removal then? I
> don't really want to mess with VMI code :-)
I would post the patch and see if Alok naks it. But I somehow doubt
vmware is doing anything profound with that call.
J
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Replace kvm io delay pv-ops with linux magic
2009-11-20 2:08 ` Jeremy Fitzhardinge
@ 2009-11-20 17:45 ` Alok Kataria
0 siblings, 0 replies; 7+ messages in thread
From: Alok Kataria @ 2009-11-20 17:45 UTC (permalink / raw)
To: Jeremy Fitzhardinge
Cc: Alexander Graf, kvm list, Nick Piggin, Glauber Costa, Avi Kivity,
virtualization@lists.linux-foundation.org, Dan Hecht
On Thu, 2009-11-19 at 18:08 -0800, Jeremy Fitzhardinge wrote:
> On 11/20/09 09:59, Alexander Graf wrote:
> >
> > On 20.11.2009, at 02:54, Jeremy Fitzhardinge wrote:
> >
> >> On 11/20/09 07:58, Alexander Graf wrote:
> >>>
> >>> Am 19.11.2009 um 23:55 schrieb Jeremy Fitzhardinge <jeremy@goop.org>:
> >>>
> >>>> On 11/18/09 20:56, Alexander Graf wrote:
> >>>>> Currently we use pv-ops to tell linux not to do anything on io_delay.
> >>>>>
> >>>>> While the basic idea is good IMHO, I don't see why we would need
> >>>>> pv-ops
> >>>>> for that. The io delay function already has a switch that can do
> >>>>> nothing
> >>>>> if you're so inclined.
> >>>>>
> >>>>> So here's a patch (stacked on top of the previous pv-ops series) that
> >>>>> removes the io delay pv-ops hook and just sets the native io delay
> >>>>> variable instead.
> >>>>>
> >>>>
> >>>> Can you just get rid of the io_delay op altogether? If KVM doesn't
> >>>> need
> >>>> it, then nobody does.
> >>>
> >>> Sure, can do. That'd be a separate patch though.
> >>
> >> Yep. A patch each for VMI and Xen to remove the dependency, and a final
> >> patch to remove the op. Hm, looks like VMI has a specific ROM call for
> >> io_delay; I wonder what it does.
> >
> > Oh so it's actually using it? Feel like doing the removal then? I
> > don't really want to mess with VMI code :-)
>
> I would post the patch and see if Alok naks it. But I somehow doubt
> vmware is doing anything profound with that call.
>
Yeah removing it is fine with me. That call is just a no-op anyways,
and, if there are other ways for avoiding the IO delay cost we can use
that one too.
Alok
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-11-20 17:45 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-18 12:56 [PATCH] Replace kvm io delay pv-ops with linux magic Alexander Graf
2009-11-19 22:55 ` Jeremy Fitzhardinge
2009-11-19 23:58 ` Alexander Graf
2009-11-20 1:54 ` Jeremy Fitzhardinge
2009-11-20 1:59 ` Alexander Graf
2009-11-20 2:08 ` Jeremy Fitzhardinge
2009-11-20 17:45 ` Alok Kataria
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox