lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Fri, 04 Nov 2011 10:59:19 +0800
From:	Shaohua Li <shaohua.li@...el.com>
To:	Jeff Moyer <jmoyer@...hat.com>
Cc:	"i@...y.li" <i@...y.li>, Zhu Yanhai <zhu.yanhai@...il.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"bcrl@...ck.org" <bcrl@...ck.org>,
	"viro@...iv.linux.org.uk" <viro@...iv.linux.org.uk>,
	"linux-aio@...ck.org" <linux-aio@...ck.org>,
	"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
	"jaxboe@...ionio.com" <jaxboe@...ionio.com>,
	Zhu Yanhai <gaoyang.zyh@...bao.com>
Subject: Re: [PATCH][RFC] A readahead complete notify approach to implement
 buffer aio

On Fri, 2011-11-04 at 02:01 +0800, Jeff Moyer wrote:
> Coly Li <i@...y.li> writes:
> 
> > On 2011年11月01日 17:00, Zhu Yanhai Wrote:
> >> The current libaio/aio has to be Direct-IO, otherwise it falls back into sync IO.
> >> However, the aio core has already been asychronous naturally. This patch adds a complete
> >> notify mechanism to implement buffer aio, the main idea is to readahead()-like in
> >> io_submit(), counts the non-uptodated pages assocaiated with each iocb, then put each ref
> >> in the bio complete path just before unlock_page(), and hook them on to the aio ring buffer
> >> finally when the ref drops to zero. In io_getevents(), we call vfs_read() as a safe net
> >> since there is still little possibility that the pages had brought in were reclaimed
> >> between io_submit() and io_getevents().
> >> 
> >> I have tested this patch for a while, for the small size random io request, its
> >> performance is more or less the same with the traditional aio, for the big io request,
> >> the overhead of one extra memory copy arises.
> >> 
> >> I think so far it has at least below obvious drawbacks,
> >> 
> >> * mpage_readpage() is a really narrow interface, I have no way to pass down
> >> the new control struct baiocb, so I just put it into struct task_struct and
> >> refer it by current() as a workaround.
> >> 
> >> * the do_baio_read() routine is heavily similar with do_generic_file_read(), but
> >> the latter is really hard to modify. I think we may stuff these code down into the
> >> readahead path to reduce code reduplication.
> >> 
> >> Hopefully the explanations are clear enough and don't muddy the water any worse.
> >> I figure the code does need some better comments, and any suggestion are welcome.
> >> 
> >> Signed-off-by: Zhu Yanhai <gaoyang.zyh@...bao.com>
> >> 
> >> ---
> >>  fs/aio.c                    |  319 ++++++++++++++++++++++++++++++++++++++++++-
> >>  fs/buffer.c                 |   26 ++++-
> >>  fs/mpage.c                  |   28 ++++-
> >>  include/linux/aio.h         |    9 ++
> >>  include/linux/aio_abi.h     |    1 +
> >>  include/linux/blk_types.h   |    2 +
> >>  include/linux/buffer_head.h |    3 +
> >>  include/linux/page-flags.h  |    2 +
> >>  include/linux/sched.h       |    1 +
> >>  9 files changed, 386 insertions(+), 5 deletions(-)
> >> 
> >
> > Hmm, I don't see the usage from user space. Is it possible to post a demo code in user space, so people are able to
> > understand how to use/test your patch.
> 
> He added a new IOCB_CMD_blah for buffered aio reads.  That is,
> unfortunately, a really poor way to go about doing things.  Please take
> a look at the work Jens did on implementing buffered aio.  It can be
> found in his linux-block git tree.
Interesting, I thought Jens's work is to make io_submit not blocking.
That's good to know it supports async buffer io too. Last time I look at
the code, it appears there still are threads to do the aio retry, so
what's the difference just letting user space thread do a sync buffer
io?

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists