The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Suparna Bhattacharya <suparna@in.ibm.com>
To: Avi Kivity <avi@redhat.com>
Cc: Zach Brown <zach.brown@oracle.com>,
	linux-aio@kvack.org, Jeff Moyer <jmoyer@redhat.com>,
	Anthony Liguori <aliguori@us.ibm.com>,
	linux-kernel@vger.kernel.org, mingo@elte.hu
Subject: Re: kvm aio wishlist
Date: Tue, 25 Nov 2008 15:49:23 +0530	[thread overview]
Message-ID: <20081125101923.GA28123@in.ibm.com> (raw)
In-Reply-To: <492BC5CB.6000609@redhat.com>


[cc'ing lkml as well ] 

On Tue, Nov 25, 2008 at 11:30:51AM +0200, Avi Kivity wrote:
> Zach Brown wrote:
>>> I'm also worried about introducing threads.  With direct I/O, we know
>>> we're going to block.  The easiest thing is to slap the request onto a
>>> queue (blockdev or netdev) and unplug it.
>>>     
>>
>> Is it really that easy?  There's a non-trivial number of places it can
>> block before submitting the IO and making it to the async completion
>> phase.  They show up as latency spikes in real-world loads.
>>
>> DIO is a good example.  Using a kernel thread lets the entire path be
>> async.  We don't have to go in and fold an async state machine under
>> pinning user space pages, performing file system block mapping lookups,
>> allocating block layer requests, on and on.
>>
>>   
>
> Certainly, filesystem backed storage is much harder.  Maybe we can use one 
> of the fork-on-demand proposals to make the block mapping async, then queue 
> the request+pinned pages.
>
>>> IIRC, the idea behind the *lets/*rils was that the calls are usually
>>> nonblocking, so you fork on block, no?  I don't see that here.  Of
>>> course, that's not the case in my wishlist; all requests will block
>>> without exception.
>>>     
>>
>> Yeah.  My thinking is that if someone wants to experiment with syslets
>> it'll be pretty easy for them to add a flag to the submission struct and
>> re-use most of the submission and completion framework.  That's not my
>> priority.  I want posix aio in glibc to work.
>>   
>
> Why not extend io_submit() to use a thread pool when going through a 
> non-aio-ready path?  Yet a new interface, with another round of integrating 
> to the previous interfaces, is not a comforting thought.  I still haven't 
> got used to the fact that aio can work with fd polling.

Even paths that provide fop->aio_read/write can be synchronous (like non
O_DIRECT filesystem read/writes) underneath, and then there could be multiple
blocking points.

BTW, Ben had implemented a fallback approach that spawned kernel threads
- it was an initial patch and didn't do any thread pooling at that time.

I had a fallback path for pollable fds which did not require thread pools
http://lwn.net/Articles/216443/ 
(limited to fds which support non blocking semantics)

OR

Maybe we could use a very simple version of syslets to do an io_submit
in libaio :) 

Does the syslet approach of continuing in a different thread (different
thread id) affect kvm ?

Regards
Suparna

>
>>> Actually without preadv/pwritev (and without changes in qemu; that has
>>> its own wishlist) we can't really make good use of this now.
>>>     
>>
>> I could trivially add preadv and pwritev to the patch series.  The vfs
>> paths already support it, it's just that we don't have a syscall entry
>> point which takes the file position from an argument instead of from the
>> file struct behind the fd.
>>
>> Would that make it an interesting experiment for you to work with?
>>   
>
> Not really -- it doesn't add anything (at the moment) that a userspace 
> thread pool doesn't have.
>
> The key here is in the richer interface to the scheduler.  If we can get 
> the async exec thread to stay on the same cpu as the user thread that 
> launched it, and to start executing on the userspace thread's return to 
> userspace, then I guess many of the problems of threads are eliminated.
>
> -- 
> error compiling committee.c: too many arguments to function
>
> --
> To unsubscribe, send a message with 'unsubscribe linux-aio' in
> the body to majordomo@kvack.org.  For more info on Linux AIO,
> see: http://www.kvack.org/aio/
> Don't email: <a href=mailto:"aart@kvack.org">aart@kvack.org</a>

       reply	other threads:[~2008-11-25 10:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <492B0CDD.7080000@redhat.com>
     [not found] ` <492B2348.9090008@oracle.com>
     [not found]   ` <492B2976.3010209@redhat.com>
     [not found]     ` <492B3912.3030707@oracle.com>
     [not found]       ` <492BC5CB.6000609@redhat.com>
2008-11-25 10:19         ` Suparna Bhattacharya [this message]
2008-11-25 10:48           ` kvm aio wishlist Avi Kivity
2008-11-25 14:59             ` Ingo Molnar
2008-11-25 15:10               ` Jens Axboe
2008-11-25 15:25                 ` Zach Brown
2008-11-25 15:57                   ` Ingo Molnar
2008-11-25 16:55                   ` Avi Kivity
2008-11-25 16:57                     ` Ingo Molnar
2008-11-25 16:51               ` Avi Kivity
2008-11-25 16:56                 ` Ingo Molnar

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=20081125101923.GA28123@in.ibm.com \
    --to=suparna@in.ibm.com \
    --cc=aliguori@us.ibm.com \
    --cc=avi@redhat.com \
    --cc=jmoyer@redhat.com \
    --cc=linux-aio@kvack.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=zach.brown@oracle.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox