Skip to contentSkip to conversation

9p: set readahead and io size according to maxsize

PATCH New Dominique Martinet 1 participant 1 message Nov 4, 2021 9P file system

lore
Share & tools
lore

Dominique Martinet

author maintainer
#0 lore raw

PATCH 1/1 9p: set readahead and io size according to maxsize

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

---
 fs/9p/vfs_super.c | 3 +++
 1 file changed, 3 insertions(+)
fs/9p/vfs_super.c +3 -0
index c6028af51925..b0632f4e337f 100644
@@ -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;
Signature · 1 line
2.31.1