From: Kent Overstreet <koverstreet@google.com>
To: Zach Brown <zab@redhat.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: Wed, 10 Oct 2012 19:51:02 -0700 [thread overview]
Message-ID: <20121011025102.GE24174@moria.home.lan> (raw)
In-Reply-To: <20121010214315.GE6371@lenny.home.zabbo.net>
On Wed, Oct 10, 2012 at 02:43:15PM -0700, Zach Brown wrote:
> > True. But that could be solved with a separate interface that either
> > doesn't use a context to submit a call synchronously, or uses an
> > implicit per thread context.
>
> Sure, but why bother if we can make the one submission interface fast
> enough to satisfy quick callers? Less is more, and all that.
Very true, if it's possible. I'm just still skeptical.
> > I don't have a _strong_ opinion there, but my intuition is that we
> > shouldn't be creating new types of handles without a good reason. I
> > don't think the annoyances are for the most part particular to file
> > descriptors, I think the tend to be applicable to handles in general and
> > at least with file descriptors they're known and solved.
>
> I strongly disagree. That descriptors are an expensive limited
> resources is a perfectly good reason to not make them required to access
> the ring.
What's so special about aio vs. epoll, and now signalfd/eventfd/timerfd
etc.?
> > That would be awesome, though for it to be worthwhile there couldn't be
> > any kernel notion of a context at all and I'm not sure if that's
> > practical. But the idea hadn't occured to me before and I'm sure you've
> > thought about it more than I have... hrm.
> >
> > Oh hey, that's what acall does :P
>
> :)
>
> > For completions though you really want the ringbuffer pinned... what do
> > you do about that?
>
> I don't think the kernel has to mandate that, no. The code has to deal
> with completions faulting, but they probably won't. In acall it
> happened that completions always came from threads that could block so
> its coping mechanism was to just use put_user() :).
Yeah, but that means the completion has to be delivered from process
context. That's not what aio does today, and it'd be a real performance
regression.
I don't know of a way around that myself.
> If userspace wants them rings locked, they can mlock() the memory.
>
> Think about it from another angle: the current mechanism of creating an
> aio ring is a way to allocate pinned memory outside of the usual mlock
> accounting. This could be abused, so aio grew an additional tunable to
> limit the number of total entries in rings in the system.
>
> By putting the ring in normal user memory we avoid that problem
> entirely.
No different from any other place the kernel allocates memory on behalf
of userspace... it needs a general solution, not a bunch of special case
solutions (though since the general solution is memcg you might argue
the cure is worse than the disease... :P)
next prev parent reply other threads:[~2012-10-11 2:51 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
2012-10-10 0:47 ` Kent Overstreet
2012-10-10 21:43 ` Zach Brown
2012-10-11 2:51 ` Kent Overstreet [this message]
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=20121011025102.GE24174@moria.home.lan \
--to=koverstreet@google.com \
--cc=dm-devel@redhat.com \
--cc=linux-bcache@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tytso@mit.edu \
--cc=zab@redhat.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
all inboxes | Powered by JetHome®