Here is another patch for the improvement of vboxsf. The key point is using page cache in the system call read/write. I created this patch by reference to the other file system(e.g. ext4, nfs, vmhgfs).
In this patch...
* To use page cache, generic_file_read_iter/generic_file_write_iter will be
called from read/write.
* the page cache will be cleared in sf_inode_revalidate if necessary.
* sf_inode_revalidate will be called in a cache sensitive function like
read_iter, write_iter.
* sf_inode_revalidate will not call unnecessary stat.
I tested this code on a kernel 3.19 Linux guest.
This patch is provided under the MIT license.
# before apply this patch
vagrant@debian-jessie:/vagrant$ for i in {0..2}; do time cat
large-file>/dev/null ; done
real 0m0.045s
user 0m0.000s
sys 0m0.020s
real 0m0.031s
user 0m0.000s
sys 0m0.016s
real 0m0.045s
user 0m0.000s
sys 0m0.020s
# after apply this patch
vagrant@debian-jessie:/vagrant$ for i in {0..2}; do time cat
large-file>/dev/null ; done
real 0m0.140s
user 0m0.000s
sys 0m0.072s
real 0m0.004s
user 0m0.000s
sys 0m0.000s
real 0m0.004s
user 0m0.000s
sys 0m0.000s
Thanks,
--
Tatsuya Karino
vboxsf_pagecache.patch
Description: Binary data
_______________________________________________ vbox-dev mailing list [email protected] https://www.virtualbox.org/mailman/listinfo/vbox-dev
