All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Sasha Levin <levinsasha928@gmail.com>,
	Avi Kivity <avi@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@elte.hu>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	kvm <kvm@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Dave Jones <davej@redhat.com>
Subject: Re: kvm: RCU warning in async pf
Date: Mon, 16 Apr 2012 15:58:48 +0300	[thread overview]
Message-ID: <20120416125848.GT11918@redhat.com> (raw)
In-Reply-To: <20120416102855.GP11918@redhat.com>

On Mon, Apr 16, 2012 at 01:28:55PM +0300, Gleb Natapov wrote:
> On Sat, Apr 14, 2012 at 11:44:53AM +0200, Peter Zijlstra wrote:
> > On Wed, 2012-04-04 at 15:30 +0300, Gleb Natapov wrote:
> > >  
> > > @@ -253,7 +254,10 @@ do_async_page_fault(struct pt_regs *regs, unsigned long error_code)
> > >  		kvm_async_pf_task_wait((u32)read_cr2());
> > >  		break;
> > >  	case KVM_PV_REASON_PAGE_READY:
> > > +		rcu_irq_enter();
> > > +		exit_idle();
> > >  		kvm_async_pf_task_wake((u32)read_cr2());
> > > +		rcu_irq_exit();
> > >  		break;
> > >  	}
> > >  }
> > 
> > Wouldn't irq_enter() / irq_exit() be more appropriate? You're basically
> > taking an interrupt/exception from idle, irq_enter() will fix up
> > everything that needs fixing up, including time sources (which the
> > scheduler expects to be up-to-date).
> > 
> You are right. Will send a patch.
> 

KVM: Call irq_enter() instead of rcu_irq_enter() during async PF.

As Peter noted there are more things that should be done when leaving
idle state. irq_(enter|exit)() does them and also call rcu functions.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index b8ba6e4..83a48f6 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -254,10 +254,10 @@ do_async_page_fault(struct pt_regs *regs, unsigned long error_code)
 		kvm_async_pf_task_wait((u32)read_cr2());
 		break;
 	case KVM_PV_REASON_PAGE_READY:
-		rcu_irq_enter();
+		irq_enter();
 		exit_idle();
 		kvm_async_pf_task_wake((u32)read_cr2());
-		rcu_irq_exit();
+		irq_exit();
 		break;
 	}
 }
--
			Gleb.

  reply	other threads:[~2012-04-16 12:58 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-03  0:54 kvm: RCU warning in async pf Sasha Levin
2012-04-03 10:52 ` Gleb Natapov
2012-04-04 12:30   ` Gleb Natapov
2012-04-04 14:04     ` Paul E. McKenney
2012-04-04 14:18       ` Gleb Natapov
2012-04-04 20:13     ` Sasha Levin
2012-04-05 16:10     ` Avi Kivity
2012-04-14  9:44     ` Peter Zijlstra
2012-04-16 10:28       ` Gleb Natapov
2012-04-16 12:58         ` Gleb Natapov [this message]
2012-04-16 13:05           ` Peter Zijlstra
2012-04-16 13:08             ` Gleb Natapov
2012-04-16 13:18               ` Peter Zijlstra
2012-04-16 13:27                 ` Peter Zijlstra
2012-04-16 14:17                   ` Gleb Natapov
2012-04-16 14:24                     ` Peter Zijlstra
2012-04-03 13:06 ` Paul E. McKenney

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=20120416125848.GT11918@redhat.com \
    --to=gleb@redhat.com \
    --cc=avi@redhat.com \
    --cc=davej@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=levinsasha928@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mtosatti@redhat.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.