All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Avi Kivity <avi@redhat.com>
Cc: Alex Williamson <alex.williamson@redhat.com>,
	gleb@redhat.com, kvm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v10 2/2] kvm: Add resampling irqfds for level triggered interrupts
Date: Wed, 19 Sep 2012 12:08:45 +0300	[thread overview]
Message-ID: <20120919090845.GA26517@redhat.com> (raw)
In-Reply-To: <50598975.50503@redhat.com>

On Wed, Sep 19, 2012 at 11:59:33AM +0300, Avi Kivity wrote:
> > @@ -247,9 +383,36 @@ kvm_irqfd_assign(struct kvm *kvm, struct kvm_irqfd *args)
> >  		/* This fd is used for another irq already. */
> >  		ret = -EBUSY;
> >  		spin_unlock_irq(&kvm->irqfds.lock);
> > +		mutex_unlock(&kvm->irq_lock);
> >  		goto fail;
> >  	}
> >  
> > +	if (resampler) {
> > +		struct _irqfd_resampler *resampler_tmp;
> > +
> > +		/*
> > +		 * Re-use a resampler if it's already registered on the
> > +		 * gsi we need.  Free the one we created above if found,
> > +		 * otherwise add to the list and setup the irq ack notifier.
> > +		 */
> > +		list_for_each_entry(resampler_tmp,
> > +				    &kvm->irqfds.resamplers, list) {
> > +			if (resampler_tmp->notifier.gsi == irqfd->gsi) {
> > +				irqfd->resampler = resampler_tmp;
> > +				break;
> > +			}
> > +		}
> > +
> > +		if (irqfd->resampler == resampler) {
> > +			list_add(&resampler->list, &kvm->irqfds.resamplers);
> > +			__kvm_register_irq_ack_notifier(kvm,
> > +							&resampler->notifier);
> > +		} else
> > +			kfree(resampler);
> > +
> > +		list_add_rcu(&irqfd->resampler_list, &irqfd->resampler->irqfds);
> > +	}
> > +
> 
> Whoa.  Can't we put the resampler entry somewhere we don't need to
> search for it?  Like a kvm_kernel_irq_routing_entry, that's indexed by
> gsi already (kvm_irq_routing_table::rt_entries[gsi]).

I'm not sure why would we bother optimizing this,
but if we do, I guess we could look for the irq notifier
which is already indexed by gsi.


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

  reply	other threads:[~2012-09-19  9:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-18  3:16 [PATCH v10 0/2] kvm: level irqfd support Alex Williamson
2012-09-18  3:16 ` [PATCH v10 1/2] kvm: Provide pre-locked setup to irq ack notifier Alex Williamson
2012-09-18  3:16 ` [PATCH v10 2/2] kvm: Add resampling irqfds for level triggered interrupts Alex Williamson
2012-09-18 23:29   ` Michael S. Tsirkin
2012-09-19  8:59   ` Avi Kivity
2012-09-19  9:08     ` Michael S. Tsirkin [this message]
2012-09-19  9:10       ` Avi Kivity
2012-09-19 13:54         ` Alex Williamson
2012-09-19 14:35           ` Avi Kivity
2012-09-19 18:23     ` Alex Williamson
2012-09-19 18:48       ` Michael S. Tsirkin
2012-09-19 19:23         ` Alex Williamson
2012-09-19 19:59           ` Michael S. Tsirkin

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=20120919090845.GA26517@redhat.com \
    --to=mst@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=avi@redhat.com \
    --cc=gleb@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@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 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.