public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Allison <jra@samba.org>
To: Ulrich Drepper <drepper@akkadia.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Jeremy Allison <jra@samba.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 09:59:54 -0700	[thread overview]
Message-ID: <20110831165954.GC1611@samba2> (raw)
In-Reply-To: <4E5E152A.9050804@akkadia.org>

On Wed, Aug 31, 2011 at 07:04:10AM -0400, Ulrich Drepper wrote:
> On 08/30/2011 07:11 PM, Andrew Morton wrote:
> > I don't know.  Uli cc'ed.
> 
> glibc has to create the parallelism of the operations through threads.
> More threads mean more overhead.  There are insane people out there who
> wrote code which pushed the number of helper threads into the hundreds
> (at that time a high number, today this would be in the thousands).
> Anyway, any scheme which is worth changing the code for would be in the
> kernel.  Only the kernel knows which requests can actually be handled
> concurrently.

I get that, but isn't that what the aio_init(const struct aioinit *init) call is meant to
solve ?

After all:

struct aioinit
  {
    int aio_threads;            /* Maximal number of threads.  */
    int aio_num;                /* Number of expected simultanious requests. */
    int aio_locks;              /* Not used.  */
    int aio_usedba;             /* Not used.  */
    int aio_debug;              /* Not used.  */
    int aio_numusers;           /* Not used.  */
    int aio_idle_time;          /* Number of seconds before idle thread
                                   terminates.  */
    int aio_reserved;
  };

Would seem to be the existing way to limit this. What I don't understand
is why you restrict the pthread aio implementation to only allow
*one* outstanding request per file descriptor ?

Surely it doesn't matter what fd the requests are outstanding on, isn't
it the total number of outstanding threads that really matter ?

By limiting this to one outstanding request per fd, this prevents
any parallelization for requests on a single file for a file server
written to use the aio interface in glibc. Windows SMB2 client issue
multiple simultaneous asynchronous requests on a single file, and
the current glibc implementation throttles them to be linear.

Volker had to create a vfs_aio_fork Samba VFS module that uses
forked processes and shared memory communication to get around
this exact problem. It does improve performance for SMB2 clients,
but means we have many more processes than we'd otherwise need
if we didn't have the restriction.

Do you have benchmark data that shows that limiting outstanding requests
to one per fd is a performance win ?

Do you want to see my patch to glibc that removes this restriction
so we can test this on any benchmarks you used to decide on the
one-request-per-fd restriction ?

Jeremy.

  reply	other threads:[~2011-08-31 16:59 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 [this message]
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

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=20110831165954.GC1611@samba2 \
    --to=jra@samba.org \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=dehrenberg@google.com \
    --cc=drepper@akkadia.org \
    --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