All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/4] block: loop: improve loop with AIO
@ 2015-05-06 17:08 Ming Lei
  2015-05-06 17:08 ` [PATCH v3 1/4] fs: kiocb: introduce IOCB_DONT_DIRTY_PAGE flag for direct IO Ming Lei
                   ` (3 more replies)
  0 siblings, 4 replies; 22+ messages in thread
From: Ming Lei @ 2015-05-06 17:08 UTC (permalink / raw)
  To: linux-kernel, Dave Kleikamp
  Cc: Jens Axboe, Zach Brown, Christoph Hellwig, Maxim Patlasov,
	Andrew Morton, Alexander Viro, Tejun Heo

Hi Guys,

There are about 3 advantages to use direct I/O and AIO on
read/write loop's backing file:

1) double cache can be avoided, then memory usage gets
decreased a lot

2) not like user space direct I/O, there isn't cost of
pinning pages

3) avoid context switch for obtaining good throughput
- in buffered file read, random I/O throughput is often obtained
only if they are submitted concurrently from lots of tasks; but for
sequential I/O, most of times they can be hit from page cache, so
concurrent submissions often introduce unnecessary context switch
and can't improve throughput much. There was such discussion[1]
to use non-blocking I/O to improve the problem for application.
- with direct I/O and AIO, concurrent submissions can be
avoided and random read throughput can't be affected meantime

So this patchset trys to improve loop via AIO, and about 45% memory
usage can be decreased, see detailed data in commit log of patch4,
also IO throughput isn't affected too.

V3:
	- based on Al's iov_iter work and Christoph's kiocb changes
	- use kthread_work
	- introduce IOCB_DONT_DIRTY_PAGE flag
	- set QUEUE_FLAG_NOMERGES for loop's request queue
V2:
	- remove 'extra' parameter to aio_kernel_alloc()
	- try to avoid memory allcation inside queue req callback
	- introduce 'use_mq' sysfs file for enabling kernel aio or disabling it
V1:
	- link:
		http://marc.info/?t=140803157700004&r=1&w=2
	- improve failure path in aio_kernel_submit()

 drivers/block/loop.c | 166 ++++++++++++++++++++++++++++++++++++++++++++----------------------
 drivers/block/loop.h |  14 +++---
 fs/direct-io.c       |  10 ++--
 include/linux/fs.h   |   1 +
 4 files changed, 126 insertions(+), 65 deletions(-)

Thanks,
Ming Lei


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2015-05-12  8:55 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-06 17:08 [PATCH v3 0/4] block: loop: improve loop with AIO Ming Lei
2015-05-06 17:08 ` [PATCH v3 1/4] fs: kiocb: introduce IOCB_DONT_DIRTY_PAGE flag for direct IO Ming Lei
2015-05-07  7:16   ` Christoph Hellwig
2015-05-07 12:12     ` Ming Lei
2015-05-11  7:19       ` Christoph Hellwig
2015-05-11 13:02         ` Ming Lei
2015-05-12  7:24           ` Christoph Hellwig
2015-05-12  8:54             ` Ming Lei
2015-05-06 17:08 ` [PATCH v3 2/4] block: loop: set QUEUE_FLAG_NOMERGES for request queue of loop Ming Lei
2015-05-06 17:08 ` [PATCH v3 3/4] block: loop: use kthread_work Ming Lei
2015-05-07  7:17   ` Christoph Hellwig
2015-05-07 10:32     ` Ming Lei
2015-05-11  7:20       ` Christoph Hellwig
2015-05-11 13:12         ` Ming Lei
2015-05-12  7:25           ` Christoph Hellwig
2015-05-12  8:55             ` Ming Lei
2015-05-06 17:08 ` [PATCH v3 4/4] block: loop: support DIO & AIO Ming Lei
2015-05-07  7:24   ` Christoph Hellwig
2015-05-07 12:32     ` Ming Lei
2015-05-07 22:20       ` Dave Chinner
2015-05-08  4:09         ` Ming Lei
2015-05-11  1:28           ` Dave Chinner

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.