On 25/01/2023 03:55, Christoph Hellwig wrote:
On Tue, Jan 24, 2023 at 10:55:25PM +0800, Anand Jain wrote:
I was curious about the commit message.
I ran fio to test the performance before and after the change.
The results were similar.
fio --group_reporting=1 --directory /mnt/test --name dioread --direct=1
--size=1g --rw=read --runtime=60 --iodepth=1024 --nrfiles=16 --numjobs=16
before this patch
READ: bw=8208KiB/s (8405kB/s), 8208KiB/s-8208KiB/s (8405kB/s-8405kB/s),
io=481MiB (504MB), run=60017-60017msec
after this patch
READ: bw=8353KiB/s (8554kB/s), 8353KiB/s-8353KiB/s (8554kB/s-8554kB/s),
io=490MiB (513MB), run=60013-60013msec
That's 4k reads. The will benefit from the inline csum array in the
btrfs_bio, but won't benefit from the existing batching, so this is
kind of expected.
The good news is that the final series will still use the inline
csum array for small reads, while also only doing a single csum tree
lookup for larger reads, so you'll get the best of both worlds.
Ok. Got this results for the whole series from an aarch64
(pagesize=64k); Results finds little improvement/same.
Before:
Last commit:
b3b1ba7b8c0d btrfs: skip backref walking during fiemap if we know the
leaf is shared
---- mkfs.btrfs /dev/vdb ..... :0 ----
---- mount -o max_inline=0 /dev/vdb /btrfs ..... :0 ----
---- fio --group_reporting=1 --directory /btrfs --name dioread
--direct=1 --size=1g --rw=read --runtime=60 --iodepth=1024 --nrfiles=16
--numjobs=16 | egrep "fio|READ" ..... :0 ----
fio-3.19
READ: bw=6052MiB/s (6346MB/s), 6052MiB/s-6052MiB/s
(6346MB/s-6346MB/s), io=16.0GiB (17.2GB), run=2707-2707msec
---- mkfs.btrfs /dev/vdb ..... :0 ----
---- mount -o max_inline=64K /dev/vdb /btrfs ..... :0 ----
---- fio --group_reporting=1 --directory /btrfs --name dioread
--direct=1 --size=1g --rw=read --runtime=60 --iodepth=1024 --nrfiles=16
--numjobs=16 | egrep "fio|READ" ..... :0 ----
fio-3.19
READ: bw=6139MiB/s (6437MB/s), 6139MiB/s-6139MiB/s
(6437MB/s-6437MB/s), io=16.0GiB (17.2GB), run=2669-2669msec
After:
last commit:
b488ab9aed15 iomap: remove IOMAP_F_ZONE_APPEND
---- mkfs.btrfs /dev/vdb ..... :0 ----
---- mount -o max_inline=0 /dev/vdb /btrfs ..... :0 ----
---- fio --group_reporting=1 --directory /btrfs --name dioread
--direct=1 --size=1g --rw=read --runtime=60 --iodepth=1024 --nrfiles=16
--numjobs=16 | egrep "fio|READ" ..... :0 ----
fio-3.19
READ: bw=6100MiB/s (6396MB/s), 6100MiB/s-6100MiB/s
(6396MB/s-6396MB/s), io=16.0GiB (17.2GB), run=2686-2686msec
---- mkfs.btrfs /dev/vdb ..... :0 ----
---- mount /dev/vdb /btrfs ..... :0 ----
---- fio --group_reporting=1 --directory /btrfs --name dioread
--direct=1 --size=1g --rw=read --runtime=60 --iodepth=1024 --nrfiles=16
--numjobs=16 | egrep "fio|READ" ..... :0 ----
fio-3.19
READ: bw=6157MiB/s (6456MB/s), 6157MiB/s-6157MiB/s
(6456MB/s-6456MB/s), io=16.0GiB (17.2GB), run=2661-2661msec