kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: Avi Kivity <avi@redhat.com>
Cc: Jan Kiszka <jan.kiszka@web.de>, kvm-devel <kvm@vger.kernel.org>
Subject: Re: assign-dev: Purpose of interrupt_work
Date: Mon, 12 Oct 2009 11:38:31 +0200	[thread overview]
Message-ID: <20091012093831.GB16702@redhat.com> (raw)
In-Reply-To: <4AD2F722.4030605@redhat.com>

On Mon, Oct 12, 2009 at 11:30:10AM +0200, Avi Kivity wrote:
> On 10/12/2009 11:25 AM, Jan Kiszka wrote:
> >>>Or what is the
> >>>alternative?
> >>>
> >>irqfd (which only supports edge-triggered interrupts now).  Note irqfd
> >>needs the same love, it uses a workqueue as well.
> >>
> >>The theory is:
> >>  fd1 = eventfd()
> >>  give fd1 to kvm as irqfd, vhost-net as trigger fd
> >>  fd2 = eventfd()
> >>  give fd2 to kvm as irqfd, uio as trigger fd
> >>  fd3 = evenfd()
> >>  give fd3 to kvm as irqfd, another kvm as ioeventfd
> >>
> >>One interface, multiple users (in the kernel, userspace, or other
> >>processes)
> >I see to overall gain, but likely only worsens my objective (low
> >latency), at least it doesn't improve it.
> 
> irqfd can work from interrupt context, so if we only use the
> workqueue for the many-vcpu cases, we should be fine.
> 
> I think we can do it cleanly, too: in ioapic code, if we're talking
> to one vcpu, wake it immediately; otherwise schedule work to
> continue in process context.  This was the common code can always
> work in interrupt context and not worry about the work queue.
> 
Even if we are talking to one cpu locking is still needed, so unless we
make it spinlock we can't inject from irq context. If we change mutex to
spinlock what is the point of work queue?

--
			Gleb.

  reply	other threads:[~2009-10-12  9:39 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-12  7:03 assign-dev: Purpose of interrupt_work Jan Kiszka
2009-10-12  7:13 ` Gleb Natapov
2009-10-12  7:27   ` Jan Kiszka
2009-10-12  7:45     ` Gleb Natapov
2009-10-12  7:50       ` Jan Kiszka
2009-10-12  7:57         ` Gleb Natapov
2009-10-12  8:16           ` Jan Kiszka
2009-10-12  8:39             ` Gleb Natapov
2009-10-12  9:04               ` Jan Kiszka
2009-10-12  9:14                 ` Avi Kivity
2009-10-12  9:25                   ` Jan Kiszka
2009-10-12  9:30                     ` Avi Kivity
2009-10-12  9:38                       ` Gleb Natapov [this message]
2009-10-12  9:40                         ` Avi Kivity
2009-10-12  9:42                           ` Gleb Natapov
2009-10-12  9:14                 ` Gleb Natapov
2009-10-12  8:39         ` Avi Kivity
2009-10-12  9:05           ` Gleb Natapov
2009-10-12  9:07             ` Avi Kivity
2009-10-12  9:07           ` Jan Kiszka
2009-10-12  9:16             ` Avi Kivity
2009-10-12 17:36             ` Marcelo Tosatti
2009-10-12 20:44               ` Jan Kiszka

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=20091012093831.GB16702@redhat.com \
    --to=gleb@redhat.com \
    --cc=avi@redhat.com \
    --cc=jan.kiszka@web.de \
    --cc=kvm@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 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).