From: Wu Fengguang Disable look-ahead for loop file. Loopback files normally contain filesystems, in which case there are already proper look-aheads in the upper layer, more look-aheads on the loopback file only ruins the read-ahead hit rate. Signed-off-by: Wu Fengguang Signed-off-by: Andrew Morton --- drivers/block/loop.c | 6 ++++++ 1 file changed, 6 insertions(+) diff -puN drivers/block/loop.c~readahead-loop-case drivers/block/loop.c --- a/drivers/block/loop.c~readahead-loop-case +++ a/drivers/block/loop.c @@ -755,6 +755,12 @@ static int loop_set_fd(struct loop_devic mapping = file->f_mapping; inode = mapping->host; + /* + * The upper layer should already do proper look-ahead, + * one more look-ahead here only ruins the cache hit rate. + */ + file->f_ra.flags |= RA_FLAG_NO_LOOKAHEAD; + if (!(file->f_mode & FMODE_WRITE)) lo_flags |= LO_FLAGS_READ_ONLY; _