From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: Chunhai Guo <guochunhai@vivo.com>, xiang@kernel.org
Cc: chao@kernel.org, zbestahu@gmail.com, jefflexu@linux.alibaba.com,
dhavale@google.com, lihongbo22@huawei.com,
linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] erofs: add direct I/O support for compressed data
Date: Mon, 22 Sep 2025 22:43:29 +0800 [thread overview]
Message-ID: <7f41c935-c352-45c5-8a24-d690755d67d3@linux.alibaba.com> (raw)
In-Reply-To: <20250922124304.489419-1-guochunhai@vivo.com>
Hi Chunhai,
On 2025/9/22 20:43, Chunhai Guo wrote:
> Direct I/O is particularly useful in memory-sensitive scenarios, as it
> provides more predictable performance by avoiding unnecessary page cache
> overheads. For example, when accessing large files such as AI model files
> that are typically read only once, buffered I/O introduces redundant page
> cache usage and extra page copies, leading to unstable performance and
> increased CPU load due to memory reclaim. While Direct I/O can avoid these.
>
> The table below shows that the performance of direct I/O is up to 54.6%
> higher than buffered I/O in the low-memory scenario. The results were
> obtained using the fio benchmark with 8 threads, each thread read a 2.5GB
> file, on ARM64 Android devices running the 6.6 kernel with an 8-core CPU
> and 12GB of memory.
>
> +--------------------------------------------------------------------------+
> | fio benchmark | buffered I/O (MiB/s) | direct I/O (MiB/s) | diff |
> |---------------------+----------------------+--------------------+--------|
> | normal scenario | 2629.8 | 3648.7 | +38.7% |
> |---------------------+----------------------+--------------------+--------|
> | low memory scenario | 2350.0 | 3633.9 | +54.6% |
> +--------------------------------------------------------------------------+
Thanks for your patch!
Yes, avoid page cache by using direct I/O for read-once data (e.g.
distributing huge LLM model) actually makes sense on my side and your test
result is impressive.
I will look into your implementation later, since it's too late for v6.18.
Let's address this feature for the v6.19 cycle.
Thanks,
Gao Xiang
>
> This patch does not support the following two cases. They will fall back to
> buffered I/O:
> (1) large folios, which will be supported in a follow-up patch.
> (2) folios with private data attached, as the private data is required by
> this direct I/O implementation.
>
> Signed-off-by: Chunhai Guo <guochunhai@vivo.com>
next prev parent reply other threads:[~2025-09-22 14:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-22 12:43 Chunhai Guo
2025-09-22 14:43 ` Gao Xiang [this message]
2025-09-23 2:08 ` kernel test robot
2025-09-23 2:20 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7f41c935-c352-45c5-8a24-d690755d67d3@linux.alibaba.com \
--to=hsiangkao@linux.alibaba.com \
--cc=chao@kernel.org \
--cc=dhavale@google.com \
--cc=guochunhai@vivo.com \
--cc=jefflexu@linux.alibaba.com \
--cc=lihongbo22@huawei.com \
--cc=linux-erofs@lists.ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=xiang@kernel.org \
--cc=zbestahu@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®