All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
	Gleb Natapov <gleb@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 11:55:47 +0200	[thread overview]
Message-ID: <4CE4F823.8030804@redhat.com> (raw)
In-Reply-To: <20101117221254.GA8296@redhat.com>

On 11/18/2010 12:12 AM, Michael S. Tsirkin wrote:
> Store irq routing table pointer in the irqfd object,
> and use that to inject MSI directly without bouncing out to
> a kernel thread.
>
> While we touch this structure, rearrange irqfd fields to make fastpath
> better packed for better cache utilization.
>
> Some notes on the design:
> - Use pointer into the rt instead of copying an entry,
>    to make it possible to use rcu, thus side-stepping
>    locking complexities.  We also save some memory this way.
> - Old workqueue code is still used for level irqs.
>    I don't think we DTRT with level anyway, however,
>    it seems easier to keep the code around as
>    it has been thought through and debugged, and fix level later than
>    rip out and re-instate it later.
>
>

> @@ -166,6 +178,7 @@ irqfd_ptable_queue_proc(struct file *file, wait_queue_head_t *wqh,
>   static int
>   kvm_irqfd_assign(struct kvm *kvm, int fd, int gsi)
>   {
> +	struct kvm_irq_routing_table *irq_rt;
>   	struct _irqfd *irqfd, *tmp;
>   	struct file *file = NULL;
>   	struct eventfd_ctx *eventfd = NULL;
> @@ -215,6 +228,10 @@ kvm_irqfd_assign(struct kvm *kvm, int fd, int gsi)
>   		goto fail;
>   	}
>
> +	rcu_read_lock();
> +	irqfd_update(kvm, irqfd, rcu_dereference(kvm->irq_routing));
> +	rcu_read_unlock();

Wow, complicated.  rcu_read_lock() protects kvm->irq_routing, while 
we're in the update side of rcu-protected irqfd->irq_entry.

A comment please.

The rest looks good, it's nice we finally got the irq injection path so 
streamlined.

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


  parent reply	other threads:[~2010-11-18  9:55 UTC|newest]

Thread overview: 22+ 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
2010-11-18  9:55 ` Avi Kivity [this message]
2010-11-18 10:57 ` Michael S. Tsirkin
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=4CE4F823.8030804@redhat.com \
    --to=avi@redhat.com \
    --cc=clalance@redhat.com \
    --cc=ghaskins@novell.com \
    --cc=gleb@redhat.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 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.