Whamcloud - gitweb
LU-13805 clio: bounce buffer for unaligned DIO 16/45616/131
authorPatrick Farrell <pfarrell@whamcloud.com>
Thu, 27 Jul 2023 18:36:30 +0000 (14:36 -0400)
committerOleg Drokin <green@whamcloud.com>
Thu, 28 Sep 2023 07:58:59 +0000 (07:58 +0000)
commit7194eb6431d2ef7245ef3b13394b60e220145187
tree998300bb1d3fc857bf2e8f442c8fdc3c67b00255
parent40bb067da1f40714af4f77d24e840fdb6285b08e
LU-13805 clio: bounce buffer for unaligned DIO

Direct I/O must normally be page aligned both in terms of
I/O size and memory alignment.  This is because the I/O
must be page aligned before being written to disk.  This
is also true for buffered I/O, but the I/O is aligned
using the page cache.

In recent versions of Lustre, direct I/O is significantly
faster than buffered I/O, due to lower overhead for page
management.  Thus it is desirable to be able to do more
I/O as direct I/O.

This patch allows unaligned direct I/O by creating a buffer
inside the kernel and aligning the I/O by copying in to
this aligned buffer.  Because the main cost of buffered I/O
is locking in the page cache rather than memcopy(), this is
still significantly faster than buffered I/O (though slower
than normal direct I/O).

This will eventually allow us to convert buffered I/O to
direct I/O when doing so would increase performance.

Here are some comparative benchmarks using IOR, all single
process.

UDIO is unaligned DIO.

io size   1M           4M          16M          64M
----------------------------------------------------------
BIO Write  | 1502 MiB/s | 1382 MiB/s | 1683 MiB/s | 1677 MiB/s
BIO Read   | 2169 MiB/s | 1902 MiB/s | 2131 MiB.s | 1955 MiB/s
DIO Write  | 1010 MiB/s | 2778 MiB/s | 5905 MiB/s | 7917 MiB/s
DIO Read   | 893 MiB/s  | 2657 MiB/s | 4724 MiB/s | 7579 MiB/s
UDIO Write | 848 MiB/s  | 1666 MiB/s | 2117 MiB/s | 2243 MiB/s
UDIO Read  | 933 MIB/s  | 2412 MiB/s | 3690 MiB/s | 5370 MiB/s

Unaligned DIO offers benefits vs buffered write and
buffered read, but is of course slower than DIO.

Notice on this node the best case DIO performance is
~8 GiB/s.  On a node with 12 GiB/s best case DIO, best case
UDIO read is 8 GiB/s and best case UDIO write is 2.5 GiB/s.

This is because UDIO read is fully parallel, UDIO write is
not.

Signed-off-by: Patrick Farrell <pfarrell@whamcloud.com>
Change-Id: I7eeebf9a608f006c8095b95f0677adb99f19d640
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/45616
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Qian Yingjin <qian@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/autoconf/lustre-core.m4
lustre/include/cl_object.h
lustre/llite/rw26.c
lustre/obdclass/cl_io.c
lustre/osd-zfs/osd_io.c
lustre/tests/sanity.sh
lustre/tests/sanityn.sh