[vbox-dev] [PATCH] Performance improvement of vboxsf by using page cache

Tatsuya Karino kokuban.kumasan at gmail.com
Thu Aug 6 14:20:16 UTC 2015


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 at 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 at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.virtualbox.org/pipermail/vbox-dev/attachments/20150806/d2ff18c2/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vboxsf_pagecache.patch
Type: application/octet-stream
Size: 4883 bytes
Desc: not available
Url : http://www.virtualbox.org/pipermail/vbox-dev/attachments/20150806/d2ff18c2/attachment.obj 


More information about the vbox-dev mailing list