kernel - Implement vm.read_shortcut support in tmpfs
* Implement tmpfs support for vm.read_shorcut_enable=1
* Approximately doubles tmpfs read() performance on 64-bit systems
for data sets which exceed the size of the buffer cache.
Example using monster (64G ram, 6.4G buffer cache, 9G test data set)
du -s -k /mp
9037196 /mp
sysctl vm.read_shortcut_enable=1
time tar cf /dev/nmonster# time tar cf /dev/null /mp
6.763u 13.275s 0:20.05 99.9% 26+66k 0+0io 0pf+0w
7.224u 12.830s 0:20.07 99.9% 26+66k 0+0io 0pf+0w
6.957u 14.924s 0:21.91 99.8% 26+66k 0+0io 0pf+0w
sysctl vm.read_shortcut_enable=0
time tar cf /dev/nmonster# time tar cf /dev/null /mp
7.510u 23.997s 0:31.52 99.9% 26+66k 0+0io 0pf+0w
7.769u 37.738s 0:45.53 99.9% 25+65k 0+0io 0pf+0w
7.716u 40.306s 0:48.04 99.9% 25+65k 0+0io 0pf+0w
* Note that variations in run time when the feature is disabled
depends on what data is already present in the buffer cache and
the cost of mapping new buffers and tearing down old buffers.
This can be substantial on large multi-way systems due to
SMP/page-table issues.