All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zach Brown <zab@zabbo.net>
To: linux-fsdevel@vger.kernel.org, gnehzuil.liu@gmail.com
Cc: Jeff Moyer <jmoyer@redhat.com>
Subject: Re: [LST/MM TOPIC] really non-blocking in aio stack
Date: Mon, 13 Feb 2012 11:34:33 -0500	[thread overview]
Message-ID: <4F393B99.6070207@zabbo.net> (raw)
In-Reply-To: <20120213153509.GA7830@gmail.com>

(dropping lsf-pc from the follow-on discussion for fsdevel)

> Although we have define EIOCBRETRY, it seems to me that it is not used
> as perfect as it can.

EIOCBRETRY is a disaster because the operations are retried in the
context of the kaio threads.  To use it safely you have to ensure that
nothing the operation will do after returning -EIOCBRETRY will reference
current-> .

Realize that this can include convoluted paths through shared code that
might have *no idea* that they're used by some other path after
EIOCBRETRY and so have to be supernaturally careful with current->
references.  It's a maintenance nightmare.

The fs/aio.c retry code has the aio thread magically assume the mm
context of the submitting thread when it calls the retry handlers.
(aio_kick_handler()).  So, great, that's one current field that happens
to be sharable.  How about others?  current->journal_info?
current->io_context?  People sometimes ask about EIOCBRETRY and vfs ops
and never mention current->link_count.

As one of the people who has sunk serious time into fs/aio.c (cc:ing my
erstwhile partner in crime), I strongly discourage investing more
resources into the fs/aio.c design.  If it were me I'd be putting
resources into async infrastructure which makes use of the current
existing sync system call handling paths.

Async calls should have no idea that they're async: no duplication of
the syscall abi in submission argument structs, no magical fget before
calling operation handlers, no iocbs being sprinkled down through kernel
call stacks, no magical return codes.

Yeah, this ends up implying heavy use of kernel threads and playing
scary games with the task_struct of the submitter and async processing
thread.  At least the scary code would be in one place.

The current alternative of requiring fragile async implementations of
system calls has a compelling history of failure. fs/aio.c has been
around for a decade and has not seen significant use outside of its
initial supported operation.

I should really get the ogg of my LCA presentation (more of a jet-lagged
rant :)) on this posted somewhere.

- z

  reply	other threads:[~2012-02-13 16:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-13 15:35 [LST/MM TOPIC] really non-blocking in aio stack Zheng Liu
2012-02-13 16:34 ` Zach Brown [this message]
2012-02-15  6:13   ` Zheng Liu

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=4F393B99.6070207@zabbo.net \
    --to=zab@zabbo.net \
    --cc=gnehzuil.liu@gmail.com \
    --cc=jmoyer@redhat.com \
    --cc=linux-fsdevel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.