lkml.org 
[lkml]   [2010]   [Nov]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH RFC] kvm: fast-path msi injection with irqfd
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.


\
 
 \ /
  Last update: 2010-11-18 11:07    [W:0.047 / U:1.856 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site