public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: Jan Blunck <jblunck@suse.de>
Cc: rt-users <linux-rt-users@vger.kernel.org>, kvm@vger.kernel.org
Subject: Re: [patch 3/3] kvm: wake up waitqueue before calling get_cpu()
Date: Thu, 9 Apr 2009 06:24:30 -0300	[thread overview]
Message-ID: <20090409092430.GB30211@amt.cnet> (raw)
In-Reply-To: <20090407235902.542493610@suse.de>


Acked-by: Marcelo Tosatti <mtosatti@redhat.com>

On Wed, Apr 08, 2009 at 01:58:56AM +0200, Jan Blunck wrote:
> This moves the get_cpu() call down to be called after we wake up the
> waiters. Therefore the waitqueue locks can savely be rt mutex.
> 
> Signed-off-by: Jan Blunck <jblunck@suse.de>
> Signed-off-by: Sven-Thorsten Dietrich <sven@thebigcorporation.com>
> ---
>  arch/x86/kvm/x86.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> Index: b/arch/x86/kvm/x86.c
> ===================================================================
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -4229,7 +4229,7 @@ static void vcpu_kick_intr(void *info)
>  void kvm_vcpu_kick(struct kvm_vcpu *vcpu)
>  {
>  	int ipi_pcpu = vcpu->cpu;
> -	int cpu = get_cpu();
> +	int cpu;
>  
>  	if (waitqueue_active(&vcpu->wq)) {
>  		wake_up_interruptible(&vcpu->wq);
> @@ -4239,6 +4239,7 @@ void kvm_vcpu_kick(struct kvm_vcpu *vcpu
>  	 * We may be called synchronously with irqs disabled in guest mode,
>  	 * So need not to call smp_call_function_single() in that case.
>  	 */
> +	cpu = get_cpu();
>  	if (vcpu->guest_mode && vcpu->cpu != cpu)
>  		smp_call_function_single(ipi_pcpu, vcpu_kick_intr, vcpu, 0);
>  	put_cpu();
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2009-04-09  9:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-07 23:58 [patch 0/3] Patches for KVM & RT Jan Blunck
2009-04-07 23:58 ` [patch 1/3] Make rt_down_read_trylock() behave like down_read_trylock() Jan Blunck
2009-04-09 13:47   ` Thomas Gleixner
2009-04-07 23:58 ` [patch 2/3] kvm: convert spin-locks to raw_spinlock_t Jan Blunck
2009-04-09  9:21   ` Marcelo Tosatti
2009-04-09 13:48   ` Thomas Gleixner
2009-04-07 23:58 ` [patch 3/3] kvm: wake up waitqueue before calling get_cpu() Jan Blunck
2009-04-09  9:24   ` Marcelo Tosatti [this message]
2009-04-09 13:48   ` Thomas Gleixner
2009-04-09 21:44 ` [patch 0/3] Patches for KVM & RT Carsten Emde
2009-04-10  7:23   ` Thomas Gleixner

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=20090409092430.GB30211@amt.cnet \
    --to=mtosatti@redhat.com \
    --cc=jblunck@suse.de \
    --cc=kvm@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.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