linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zach Brown <zab@redhat.com>
To: Kent Overstreet <koverstreet@google.com>
Cc: linux-bcache@vger.kernel.org, linux-kernel@vger.kernel.org,
	dm-devel@redhat.com, tytso@mit.edu
Subject: Re: [PATCH 5/5] aio: Refactor aio_read_evt, use cmxchg(), fix bug
Date: Tue, 9 Oct 2012 17:26:34 -0700	[thread overview]
Message-ID: <20121010002634.GX26187@lenny.home.zabbo.net> (raw)
In-Reply-To: <20121010000600.GB26835@google.com>

> The AIO ringbuffer stuff just annoys me more than most

Not more than everyone, though, I can personally promise you that :).

> (it wasn't until
> the other day that I realized it was actually exported to userspace...
> what led to figuring that out was noticing aio_context_t was a ulong,
> and got truncated to 32 bits with a 32 bit program running on a 64 bit
> kernel. I'd been horribly misled by the code comments and the lack of
> documentation.) 

Yeah.  It's the userspace address of the mmaped ring.  This has annoyed
the process migration people who can't recreate the context in a new
kernel because there's no userspace interface to specify creation of a
context at a specific address.

> But if we do have an explicit handle, I don't see why it shouldn't be a
> file descriptor.

Because they're expensive to create and destroy when compared to a
single system call.  Imagine that we're using waiting for a single
completion to implement a cheap one-off sync call.  Imagine it's a
buffered op which happens to hit the cache and is really quick.

(And they're annoying to manage: libraries and O_CLOEXEC, running into
fd/file limit tunables, bleh.)

If the 'completion context' is no more than a structure in userspace
memory then a lot of stuff just works.  Tasks can share it amongst
themselves as they see fit.  A trivial one-off sync call can just dump
it on the stack and point to it.  It doesn't have to be specifically
torn down on task exit.

> > And perhaps obviously, I'd start with the acall stuff :).  It was a lot
> > lighter.  We could talk about how to make it extensible without going
> > all the way to the generic packed variable size duplicating or not and
> > returning or not or.. attributes :).
> 
> Link? I haven't heard of acall before.

I linked to it after that giant silly comment earlier in the thread,
here it is again:

  http://lwn.net/Articles/316806/

There's a mostly embarassing video of a jetlagged me giving that talk at
LCA kicking around.. ah, here:

 http://mirror.linux.org.au/pub/linux.conf.au/2009/Thursday/131.ogg

- z

  reply	other threads:[~2012-10-10  0:26 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-09  6:39 [PATCH 1/5] aio: Kill return value of aio_complete() Kent Overstreet
2012-10-09  6:39 ` [PATCH 2/5] aio: kiocb_cancel() Kent Overstreet
2012-10-09 18:26   ` Zach Brown
2012-10-09 21:37     ` Kent Overstreet
2012-10-10 11:03       ` Theodore Ts'o
2012-10-10 21:20         ` Zach Brown
2012-10-10 23:21           ` Theodore Ts'o
2012-10-11  2:41         ` Kent Overstreet
2012-10-09  6:39 ` [PATCH 3/5] aio: Rewrite refcounting Kent Overstreet
2012-10-09 18:27   ` Zach Brown
2012-10-09 22:21     ` Kent Overstreet
2012-10-09 22:35       ` Zach Brown
2012-10-10  0:17         ` Kent Overstreet
2012-10-09  6:39 ` [PATCH 4/5] aio: vmap ringbuffer Kent Overstreet
2012-10-09 18:29   ` Zach Brown
2012-10-09 21:31     ` Kent Overstreet
2012-10-09 22:32       ` Zach Brown
2012-10-09 22:44         ` Kent Overstreet
2012-10-09 22:58           ` Zach Brown
2012-10-10  0:16             ` Kent Overstreet
2012-10-10  0:36               ` Zach Brown
2012-10-10  1:09                 ` Kent Overstreet
2012-10-09  6:39 ` [PATCH 5/5] aio: Refactor aio_read_evt, use cmxchg(), fix bug Kent Overstreet
2012-10-09 18:37   ` Zach Brown
2012-10-09 21:27     ` Kent Overstreet
2012-10-09 22:47       ` Zach Brown
2012-10-09 22:55         ` Kent Overstreet
2012-10-09 23:10           ` Zach Brown
2012-10-10  0:06             ` Kent Overstreet
2012-10-10  0:26               ` Zach Brown [this message]
2012-10-10  0:47                 ` Kent Overstreet
2012-10-10 21:43                   ` Zach Brown
2012-10-11  2:51                     ` Kent Overstreet
2012-10-11 16:43                       ` Zach Brown
2012-10-09 18:25 ` [PATCH 1/5] aio: Kill return value of aio_complete() Zach Brown

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=20121010002634.GX26187@lenny.home.zabbo.net \
    --to=zab@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=koverstreet@google.com \
    --cc=linux-bcache@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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).