OSDN Git Service

ovl: implement async IO routines
authorJiufei Xue <jiufei.xue@linux.alibaba.com>
Wed, 20 Nov 2019 09:45:26 +0000 (17:45 +0800)
committerMiklos Szeredi <mszeredi@redhat.com>
Fri, 24 Jan 2020 08:46:46 +0000 (09:46 +0100)
commit2406a307ac7ddfd7effeeaff6947149ec6a95b4e
treeb587599d876d0aa332977e742dd778ae5c91a09e
parent5dcdc43e24a1810d3c3f4959af3d0c8e0026d863
ovl: implement async IO routines

A performance regression was observed since linux v4.19 with aio test using
fio with iodepth 128 on overlayfs.  The queue depth of the device was
always 1 which is unexpected.

After investigation, it was found that commit 16914e6fc7e1 ("ovl: add
ovl_read_iter()") and commit 2a92e07edc5e ("ovl: add ovl_write_iter()")
resulted in vfs_iter_{read,write} being called on underlying filesystem,
which always results in syncronous IO.

Implement async IO for stacked reading and writing.  This resolves the
performance regresion.

This is implemented by allocating a new kiocb for submitting the AIO
request on the underlying filesystem.  When the request is completed, the
new kiocb is freed and the completion callback is called on the original
iocb.

Signed-off-by: Jiufei Xue <jiufei.xue@linux.alibaba.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/overlayfs/file.c
fs/overlayfs/overlayfs.h
fs/overlayfs/super.c