As requested, fix up readahead_expand() so as to not confuse the ondemand algorithm. Also make the documentation slightly better. Dave, could you put in some debug and check this actually works? I don't generally test with any filesystems that use readahead_expand(), but printing (index, nr_to_read, lookahead_size) in page_cache_ra_unbounded() would let a human (such as your good self) determine whether it's working approximately as designed. This is against linux-next 20210407. Matthew Wilcox (Oracle) (3): mm/filemap: Pass the file_ra_state in the ractl fs: Document file_ra_state mm/readahead: Adjust file_ra in readahead_expand fs/ext4/verity.c | 2 +- fs/f2fs/file.c | 2 +- fs/f2fs/verity.c | 2 +- include/linux/fs.h | 24 ++++++++++++++---------- include/linux/pagemap.h | 20 +++++++++++--------- mm/filemap.c | 4 ++-- mm/internal.h | 7 +++---- mm/readahead.c | 25 ++++++++++++++----------- 8 files changed, 47 insertions(+), 39 deletions(-) -- 2.30.2