kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: Get rid of KVM_REQ_KICK
Date: Tue, 04 May 2010 19:49:40 +0300	[thread overview]
Message-ID: <4BE05024.70608@redhat.com> (raw)
In-Reply-To: <4BE04E85.8020608@redhat.com>

On 05/04/2010 07:42 PM, Avi Kivity wrote:
>>> @@ -5470,7 +5473,7 @@ void kvm_vcpu_kick(struct kvm_vcpu *vcpu)
>>>
>>>       me = get_cpu();
>>>       if (cpu != me&&  (unsigned)cpu<  nr_cpu_ids&&  cpu_online(cpu))
>>> -        if (!test_and_set_bit(KVM_REQ_KICK,&vcpu->requests))
>>> +        if (atomic_xchg(&vcpu->guest_mode, 0))
>>>               smp_send_reschedule(cpu);
>>>       put_cpu();
>
>
> The atomic_xchg() does the trick.
>

btw, things like this should go into locking.txt.  It's definitely tricky.

-- 
error compiling committee.c: too many arguments to function


  reply	other threads:[~2010-05-04 16:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-03 14:19 [PATCH] KVM: Get rid of KVM_REQ_KICK Avi Kivity
2010-05-04 16:31 ` Marcelo Tosatti
2010-05-04 16:42   ` Avi Kivity
2010-05-04 16:49     ` Avi Kivity [this message]
2010-05-06 19:56 ` Marcelo Tosatti

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=4BE05024.70608@redhat.com \
    --to=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).