git: kernel - Fix a race and enable the VM read shortcut feature by default
dillon at crater.dragonflybsd.org
Mon Feb 18 12:15:40 PST 2013
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date: Mon Feb 18 12:08:29 2013 -0800
kernel - Fix a race and enable the VM read shortcut feature by default
* Fix a lookup/access race. No known cases hit the race but decided
it needed to be fixed for safety.
Instead of looking up and holding the VM page we know try to busy it,
and only access the content if we are able to do so non-blocking.
This costs a bit more in overhead but handles the page more properly.
time tar cf /dev/null .
0.734u 5.781s 0:06.51 100.0% 24+66k 0+0io 0pf+0w (shorcut disabled)
0.664u 2.382s 0:03.05 99.6% 24+66k 0+0io 0pf+0w (shorcut enabled)
* Default vm.read_shortcut_enable to 1. The feature is now enabled by
* The feature has been in the tree a while default disabled and needs wider
use, so it is being enabled by default. The feature is only useful on
64-bit systems (i.e. so the DMAP can be used). It allows the buffer
cache and the VM page mapping code to be completely bypassed in situations
where the file data is available in the VM page cache.
Summary of changes:
sys/kern/vfs_helper.c | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
DragonFly BSD source repository
More information about the Commits