From: Gleb Natapov <gleb@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Avi Kivity <avi@redhat.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>,
Gregory Haskins <ghaskins@novell.com>,
Chris Lalancette <clalance@redhat.com>,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC] kvm: fast-path msi injection with irqfd
Date: Thu, 18 Nov 2010 12:04:34 +0200 [thread overview]
Message-ID: <20101118100434.GB7948@redhat.com> (raw)
In-Reply-To: <20101118093426.GH16832@redhat.com>
On Thu, Nov 18, 2010 at 11:34:26AM +0200, Michael S. Tsirkin wrote:
> > > @@ -125,10 +129,18 @@ irqfd_wakeup(wait_queue_t *wait, unsigned mode, int sync, void *key)
> > > {
> > > struct _irqfd *irqfd = container_of(wait, struct _irqfd, wait);
> > > unsigned long flags = (unsigned long)key;
> > > + struct kvm_kernel_irq_routing_entry *irq;
> > >
> > > - if (flags & POLLIN)
> > > + if (flags & POLLIN) {
> > > + rcu_read_lock();
> > > + irq = irqfd->irq_entry;
> > Why not rcu_dereference()?
>
> Of course. Good catch, thanks.
>
> > And why it can't be zero here?
>
> It can, I check below.
>
Yeah, missed that. Thanks.
> > > /* An event has been signaled, inject an interrupt */
> > > - schedule_work(&irqfd->inject);
> > > + if (irq)
> > > + kvm_set_msi(irq, irqfd->kvm, KVM_USERSPACE_IRQ_SOURCE_ID, 1);
> > > + else
> > > + schedule_work(&irqfd->inject);
> > > + rcu_read_unlock();
> > > + }
> > >
--
Gleb.
next prev parent reply other threads:[~2010-11-18 10:04 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-17 22:12 [PATCH RFC] kvm: fast-path msi injection with irqfd Michael S. Tsirkin
2010-11-18 9:05 ` Gleb Natapov
2010-11-18 9:16 ` Michael S. Tsirkin
2010-11-18 9:20 ` Gleb Natapov
2010-11-18 9:34 ` Michael S. Tsirkin
2010-11-18 10:04 ` Gleb Natapov [this message]
2010-11-18 9:55 ` Avi Kivity
2010-11-18 10:57 ` Michael S. Tsirkin
2010-11-18 11:03 ` Avi Kivity
2010-11-18 11:10 ` Michael S. Tsirkin
2010-11-18 12:29 ` Avi Kivity
2010-11-18 13:03 ` Michael S. Tsirkin
2010-11-18 13:09 ` Avi Kivity
2010-11-18 13:14 ` Gleb Natapov
2010-11-18 13:18 ` Avi Kivity
2010-11-18 13:20 ` Michael S. Tsirkin
2010-11-18 13:35 ` Gleb Natapov
2010-11-18 13:39 ` Avi Kivity
2010-11-18 13:49 ` Michael S. Tsirkin
2010-11-18 13:48 ` Michael S. Tsirkin
2010-11-18 14:39 ` Gleb Natapov
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=20101118100434.GB7948@redhat.com \
--to=gleb@redhat.com \
--cc=avi@redhat.com \
--cc=clalance@redhat.com \
--cc=ghaskins@novell.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=mtosatti@redhat.com \
--cc=xiaoguangrong@cn.fujitsu.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