public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Gleb Natapov <gleb@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Daniel Ehrenberg <dehrenberg@google.com>,
	Jens Axboe <axboe@kernel.dk>, Jeff Moyer <jmoyer@redhat.com>,
	linux-kernel@vger.kernel.org, linux-aio@kvack.org
Subject: Re: Approaches to making io_submit not block
Date: Wed, 31 Aug 2011 19:02:24 +0300	[thread overview]
Message-ID: <4E5E5B10.6000503@redhat.com> (raw)
In-Reply-To: <20110831154558.GA12259@redhat.com>

On 08/31/2011 06:45 PM, Gleb Natapov wrote:
> KVM also have similar needs. KVM has x86 emulator in kernel which is,
> in fact, a state machines that sometimes need an input from userspace
> to proceed.  Currently, when userspace input is needed, KVM goes back
> to userspace to retrieve the input and than retries the emulation. Some
> instructions may require several such iterations. This is somewhat similar
> to aio except that in KVM case emulation waits for userspace instead of
> disk/network HW. The resulting code is complex and error prone. It would
> be nice to not have to unwind the stack from the middle of the emulator
> just to be able to exit to userspace to retrieve the value. One idea that
> came up was to execute emulator on separate kernel stack (withing same
> task). When emulator needs a value from userspace it sleeps while main
> stack goes to userspace to get the value. When the value is available
> main stack wakes up emulator stack and emulation continues from the
> place it was stopped. Cooperative multithreading inside the kernel
> if you want. Bellow is the patch I prototyped to implement that on
> x86_64. I made KVM x86 emulator to use it too. I think AIO can use the
> same technique. io_submit will execute IO on alternative stack. If it
> blocks main thread will continue to run. When IO is completed IO stack
> will resume (alternative stack has priority over main stack).
>

Note that kvm has a significant interest in linux-aio as well - we see a 
significant performance win when we can use it.  From my point of view 
extending linux-aio to be truly asynchronous in all cases is the bigger 
win here, the emulator issue is a nice code cleanup but we could live 
without it.

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


      reply	other threads:[~2011-08-31 16:03 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-29 17:33 Approaches to making io_submit not block Daniel Ehrenberg
2011-08-30  5:32 ` Christoph Hellwig
2011-08-30 21:51   ` Daniel Ehrenberg
2011-08-31  5:26     ` Christoph Hellwig
2011-08-31 17:08       ` Andi Kleen
2011-08-31 21:00         ` Daniel Ehrenberg
2011-08-31 21:15           ` Andi Kleen
2011-09-01  4:18         ` Dave Chinner
2011-09-01  4:39           ` Andi Kleen
2011-09-01  6:54             ` Dave Chinner
2011-09-02 13:08               ` Ted Ts'o
2011-09-02 13:10                 ` Christoph Hellwig
2011-09-01  3:39       ` Dave Chinner
2011-09-01  4:20         ` Christoph Hellwig
2011-08-30  7:02 ` Andi Kleen
     [not found] ` <CAAK6Zt0Sh1GdEOb-tNf2FGXJs=e1Jbcqew13R_GdTqrv6vW97w@mail.gmail.com>
     [not found]   ` <x49k49uk2ox.fsf@segfault.boston.devel.redhat.com>
     [not found]     ` <4E5D5817.6040704@kernel.dk>
2011-08-30 22:19       ` Daniel Ehrenberg
2011-08-30 22:32         ` Jens Axboe
2011-08-30 22:41           ` Andrew Morton
2011-08-30 22:45             ` Daniel Ehrenberg
2011-08-30 22:54               ` Andrew Morton
2011-08-30 23:03                 ` Jeremy Allison
2011-08-30 23:11                   ` Andrew Morton
2011-08-31 11:04                     ` Ulrich Drepper
2011-08-31 16:59                       ` Jeremy Allison
2011-09-01 11:14                         ` Ulrich Drepper
2011-09-01 15:58                           ` Jeremy Allison
2011-09-01 16:04                             ` Christoph Hellwig
2011-09-01 16:15                               ` Jeremy Allison
2011-09-01 16:23                                 ` Christoph Hellwig
2011-09-01 16:31                                   ` Jeremy Allison
2011-09-01 16:34                                     ` Christoph Hellwig
2011-09-01 16:34                                     ` Jeremy Allison
2011-09-01 16:45                                       ` Christoph Hellwig
2011-09-01 16:57                                         ` Jeremy Allison
2011-08-31  5:34                   ` Christoph Hellwig
2011-08-31  6:04                 ` guy keren
2011-08-31 23:16                   ` Daniel Ehrenberg
2011-08-31 23:48                     ` guy keren
2011-08-31 23:59                       ` Daniel Ehrenberg
2011-08-31 15:45                 ` Gleb Natapov
2011-08-31 16:02                   ` Avi Kivity [this message]

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=4E5E5B10.6000503@redhat.com \
    --to=avi@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=dehrenberg@google.com \
    --cc=gleb@redhat.com \
    --cc=jmoyer@redhat.com \
    --cc=linux-aio@kvack.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox