Re: [ISSUE] Read performance regression when using RWF_DONTCACHE form 8026e49 "mm/filemap: add read support for RWF_DONTCACHE"

From: Matthew Wilcox

Date: Wed Apr 15 2026 - 09:50:36 EST


On Wed, Apr 15, 2026 at 03:28:27PM +0800, Mingyu He wrote:
> I found this feature quite useful because in many scenarios, files
> only need to be read once and then discarded. Keeping them in the page
> cache can lead to a drop in read performance during cache reclaim.
> Therefore, I conducted functional tests after the official release of
> v7.0.0. I found that in normal preadv2 read scenarios (write has not
> been tested yet), the read performance actually has a significant
> regression. I would like to discuss whether this is expected, or if my
> usage or application scenario is incorrect.

Your entire premise is wrong. This is not a magic "make I/O go faster"
flag. Comparing it to cached I/O is entirely wrong; your workload
clearly benefits from readahead and you've asked to not do readahead
by specifying RWF_DONTCACHE.

Rather you should compare against O_DIRECT reads.