]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
erofs: use buffered I/O for file-backed mounts by default
authorGao Xiang <hsiangkao@linux.alibaba.com>
Thu, 12 Dec 2024 13:43:36 +0000 (21:43 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Dec 2024 13:02:00 +0000 (14:02 +0100)
commit30424481090d8e0259fed2ca310e7edfe9e9eaae
treebb590d431a718d02c0d8393078c7697f335b8738
parentf067d3f69d19629df29050ef0dd9d282aa800d32
erofs: use buffered I/O for file-backed mounts by default

[ Upstream commit 6422cde1b0d5a31b206b263417c1c2b3c80fe82c ]

For many use cases (e.g. container images are just fetched from remote),
performance will be impacted if underlay page cache is up-to-date but
direct i/o flushes dirty pages first.

Instead, let's use buffered I/O by default to keep in sync with loop
devices and add a (re)mount option to explicitly give a try to use
direct I/O if supported by the underlying files.

The container startup time is improved as below:
[workload] docker.io/library/workpress:latest
                                     unpack        1st run  non-1st runs
EROFS snapshotter buffered I/O file  4.586404265s  0.308s   0.198s
EROFS snapshotter direct I/O file    4.581742849s  2.238s   0.222s
EROFS snapshotter loop               4.596023152s  0.346s   0.201s
Overlayfs snapshotter                5.382851037s  0.206s   0.214s

Fixes: fb176750266a ("erofs: add file-backed mount support")
Cc: Derek McGowan <derek@mcg.dev>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20241212134336.2059899-1-hsiangkao@linux.alibaba.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/erofs/fileio.c
fs/erofs/internal.h
fs/erofs/super.c