public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: kvm list <kvm@vger.kernel.org>
Cc: virtualization@lists.linux-foundation.org,
	Glauber Costa <glommer@redhat.com>, Avi Kivity <avi@redhat.com>,
	Nick Piggin <npiggin@suse.de>,
	Marcelo Tosatti <mtosatti@redhat.com>
Subject: [PATCH] Replace kvm io delay pv-ops with linux magic
Date: Wed, 18 Nov 2009 13:56:24 +0100	[thread overview]
Message-ID: <1258548984-32433-1-git-send-email-agraf@suse.de> (raw)

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


             reply	other threads:[~2009-11-18 12:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-18 12:56 Alexander Graf [this message]
2009-11-19 22:55 ` [PATCH] Replace kvm io delay pv-ops with linux magic 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

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=1258548984-32433-1-git-send-email-agraf@suse.de \
    --to=agraf@suse.de \
    --cc=avi@redhat.com \
    --cc=glommer@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=npiggin@suse.de \
    --cc=virtualization@lists.linux-foundation.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