Skip to contentSkip to conversation

Replace kvm io delay pv-ops with linux magic

PATCH In review Alexander Graf 3 participants 13 messages Nov 18, 2009 – Nov 20, 2009

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Replace kvm io delay pv-ops with linux magic

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.

---
 arch/x86/Kconfig      |   14 --------------
 arch/x86/kernel/kvm.c |   16 +++-------------
 2 files changed, 3 insertions(+), 27 deletions(-)
arch/x86/Kconfig +0 -14
index 97d4f92..ebed686 100644
@@ -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
arch/x86/kernel/kvm.c +3 -13
index 7e0207f..be182e6 100644
@@ -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)) {
Signature · 1 line
1.6.0.2
#1 lore raw
Quoted 10 lines · Alexander Graf

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

Quoted 69 lines
---
 arch/x86/Kconfig      |   14 --------------
 arch/x86/kernel/kvm.c |   16 +++-------------
 2 files changed, 3 insertions(+), 27 deletions(-)
arch/x86/Kconfig +0 -14
index 97d4f92..ebed686 100644
@@ -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
arch/x86/kernel/kvm.c +3 -13
index 7e0207f..be182e6 100644
@@ -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)) {
#2 lore raw

Am 19.11.2009 um 23:55 schrieb Jeremy Fitzhardinge <[email protected]>:

Quoted 7 lines · Alexander Graf
Quoted 6 lines

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.

Quoted 7 lines
Quoted 4 lines

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

#3 lore raw
Quoted 16 lines · Alexander Graf

Am 19.11.2009 um 23:55 schrieb Jeremy Fitzhardinge <[email protected]>:

Quoted 13 lines · Alexander Graf
Quoted 11 lines

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.

Quoted 4 lines
Quoted 2 lines

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

#4 lore raw
In reply to Alexander Graf
Quoted 16 lines · Alexander Graf

Am 19.11.2009 um 23:55 schrieb Jeremy Fitzhardinge <[email protected]>:

Quoted 13 lines · Alexander Graf
Quoted 11 lines

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.

Quoted 4 lines
Quoted 2 lines

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

#5 lore raw
Quoted 17 lines · Jeremy Fitzhardinge
Quoted 16 lines · Alexander Graf

Am 19.11.2009 um 23:55 schrieb Jeremy Fitzhardinge <[email protected]>:

Quoted 13 lines · Alexander Graf
Quoted 11 lines

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.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

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

#6 lore raw
Quoted 25 lines · Alexander Graf
Quoted 22 lines · Jeremy Fitzhardinge
Quoted 21 lines · Alexander Graf

Am 19.11.2009 um 23:55 schrieb Jeremy Fitzhardinge <[email protected]>:

Quoted 17 lines · Alexander Graf
Quoted 8 lines

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.

Quoted 4 lines

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.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

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

#7 lore raw
In reply to Alexander Graf
Quoted 25 lines · Alexander Graf
Quoted 22 lines · Jeremy Fitzhardinge
Quoted 21 lines · Alexander Graf

Am 19.11.2009 um 23:55 schrieb Jeremy Fitzhardinge <[email protected]>:

Quoted 17 lines · Alexander Graf
Quoted 8 lines

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.

Quoted 4 lines

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.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

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

#8 lore raw
Quoted 32 lines · Jeremy Fitzhardinge
Quoted 31 lines · Alexander Graf
Quoted 27 lines · Jeremy Fitzhardinge
Quoted 17 lines · Alexander Graf

Am 19.11.2009 um 23:55 schrieb Jeremy Fitzhardinge <[email protected]>:

Quoted 14 lines · Alexander Graf
Quoted 12 lines

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.

Quoted 5 lines
Quoted 3 lines

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.

Quoted 6 lines
Quoted 2 lines

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

#9 lore raw
In reply to Jeremy Fitzhardinge
Quoted 32 lines · Jeremy Fitzhardinge
Quoted 31 lines · Alexander Graf
Quoted 27 lines · Jeremy Fitzhardinge
Quoted 17 lines · Alexander Graf

Am 19.11.2009 um 23:55 schrieb Jeremy Fitzhardinge <[email protected]>:

Quoted 14 lines · Alexander Graf
Quoted 12 lines

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.

Quoted 5 lines
Quoted 3 lines

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.

Quoted 6 lines
Quoted 2 lines

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

#10 lore raw
In reply to Jeremy Fitzhardinge
Quoted 24 lines · Jeremy Fitzhardinge
Quoted 23 lines · Alexander Graf

Am 19.11.2009 um 23:55 schrieb Jeremy Fitzhardinge <[email protected]>:

Quoted 19 lines · Alexander Graf
Quoted 9 lines

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.

Quoted 5 lines

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.

Quoted 7 lines
Quoted 1 line

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

#11 lore raw
In reply to Jeremy Fitzhardinge

Am 19.11.2009 um 23:55 schrieb Jeremy Fitzhardinge <[email protected]>:

Quoted 9 lines · Alexander Graf
Quoted 8 lines

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.

Quoted 8 lines
Quoted 4 lines

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

#12 lore raw
In reply to Alexander Graf
Quoted 10 lines · Alexander Graf

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

Quoted 69 lines
---
 arch/x86/Kconfig      |   14 --------------
 arch/x86/kernel/kvm.c |   16 +++-------------
 2 files changed, 3 insertions(+), 27 deletions(-)
arch/x86/Kconfig +0 -14
index 97d4f92..ebed686 100644
@@ -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
arch/x86/kernel/kvm.c +3 -13
index 7e0207f..be182e6 100644
@@ -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)) {