Skip to content

Commit

Permalink
9p: set readahead and io size according to maxsize
Browse files Browse the repository at this point in the history
having a readahead of 128k with a msize of 128k (with overhead) lead to
reading 124+4k everytime, making two roundtrips needlessly.

tune readahead according to msize when cache is enabled for better
performance

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Dominique Martinet <[email protected]>
  • Loading branch information
martinetd committed Nov 4, 2021
1 parent 05f975c commit b1843d2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/9p/vfs_super.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ v9fs_fill_super(struct super_block *sb, struct v9fs_session_info *v9ses,
if (!v9ses->cache) {
sb->s_bdi->ra_pages = 0;
sb->s_bdi->io_pages = 0;
} else {
sb->s_bdi->ra_pages = v9ses->maxdata >> PAGE_SHIFT;
sb->s_bdi->io_pages = v9ses->maxdata >> PAGE_SHIFT;
}

sb->s_flags |= SB_ACTIVE | SB_DIRSYNC;
Expand Down

0 comments on commit b1843d2

Please sign in to comment.