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.
/usr/obj/usr/src
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
default.
* 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.