From: Benjamin LaHaise <ben@communityfibre.ca>
To: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>,
linux-fsdevel@vger.kernel.org, linux-aio@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] aio: Support read/write with non-iter file-ops
Date: Thu, 18 Jul 2019 19:56:16 -0400 [thread overview]
Message-ID: <20190718235616.GM29731@kvack.org> (raw)
In-Reply-To: <20190718234352.GN30636@minitux>
On Thu, Jul 18, 2019 at 04:43:52PM -0700, Bjorn Andersson wrote:
> On Thu 18 Jul 16:17 PDT 2019, Al Viro wrote:
>
> > On Thu, Jul 18, 2019 at 04:10:54PM -0700, Bjorn Andersson wrote:
> > > Implement a wrapper for aio_read()/write() to allow async IO on files
> > > not implementing the iter version of read/write, such as sysfs. This
> > > mimics how readv/writev uses non-iter ops in do_loop_readv_writev().
> >
> > IDGI. How would that IO manage to be async? And what's the point
> > using aio in such situations in the first place?
>
> The point is that an application using aio to submit io operations on a
> set of files, can use the same mechanism to read/write files that
> happens to be implemented by driver only implementing read/write (not
> read_iter/write_iter) in the registered file_operations struct, such as
> kernfs.
>
> In this particular case I have a sysfs file that is accessing hardware
> and hence will block for a while and using this patch I can io_submit()
> a write and handle the completion of this in my normal event loop.
>
>
> Each individual io operation will be just as synchronous as the current
> iter-based mechanism - for the drivers that implement that.
Just adding the fops is not enough. I have patches floating around at
Solace that add thread based fallbacks for files that don't have an aio
read / write implementation, but I'm not working on that code any more.
The thread based methods were quite useful in applications that had a need
for using other kernel infrastructure in their main event loops.
-ben
> Regards,
> Bjorn
>
--
"Thought is the essence of where you are now."
next prev parent reply other threads:[~2019-07-19 0:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-18 23:10 [PATCH] aio: Support read/write with non-iter file-ops Bjorn Andersson
2019-07-18 23:17 ` Al Viro
2019-07-18 23:43 ` Bjorn Andersson
2019-07-18 23:56 ` Benjamin LaHaise [this message]
2019-07-19 0:36 ` Bjorn Andersson
2019-07-19 0:07 ` Al Viro
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=20190718235616.GM29731@kvack.org \
--to=ben@communityfibre.ca \
--cc=bjorn.andersson@linaro.org \
--cc=linux-aio@kvack.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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).