Ubc: An Efficient Unified I/O and Memory Caching Subsystem For Netbsd
Ubc: An Efficient Unified I/O and Memory Caching Subsystem For Netbsd
Ubc: An Efficient Unified I/O and Memory Caching Subsystem For Netbsd
Chuck Silvers
The NetBSD Project
chuq@chuq.com, http://www.netbsd.org/
The last of the operating systems we examined, HP- UBC obviously needs much improvement in the area of
UX, takes a completely different stance on the issue of write performance. This is partly due to UVM not being
how to cache filesystem data. HP-UX continues to store very efficient about flushing modified pages when mem-
file data in both the buffer cache and the page cache, ory is low and partly because the filesystem code cur-
though it does avoid the extra of copying of data that is rently doesn’t trigger any asynchronous writes to disk
present in pre-UBC NetBSD by reading data from disk during a big sequence of writes, so the writes to disk
directly into the page cache. The reasoning behind this are all started by the inefficient UVM code. We’ve been
is apparently that most files are only accessed by either concentrating on read performance so far, so this poor
read()/write() or mmap(), but not both, so as long write performance is not surprising.
as both mechanisms perform well individually, there’s
no need to redesign HP-UX just to fix the coherency is- The interesting part of this test series is the set of tests
sue. There is some attempt made to avoid incoherency where we read the same 50MB file five times. This
between the two caches, but locking constraints prevent clearly shows the benefit of the increased memory avail-
this from being completely effective. able for caching in the UBC system over NetBSD with-
out UBC. In NetBSD 1.4.2, all five reads occured at the
There are other operating systems which have imple- speed of the device, whereas in all the other systems
mented a unified cache (eg. Compaq’s Tru64 UNIX and the reads were completed at memory speed after sev-
IBM’s AIX), but we were unable to find information on eral runs. We have no explanation for why FreeBSD and
the design of these operating systems for comparison. Linux didn’t complete the second 50MB read at memory
speed, or why Linux didn’t complete even the third read
Experiment Run Time (seconds)
Input Output Size NetBSD NetBSD FreeBSD Linux
1.4.2 with UBC 3.4 2.2.12-20smp
raw device /dev/null 1GB 72.8 72.7 279.3 254.6
/dev/zero new file 1GB 83.8 193.0 194.3 163.9
/dev/zero overwrite file 1GB 79.4 186.6 192.2 167.3
non-resident file /dev/null 1GB 72.7 86.7 279.3 254.5
non-resident file /dev/null 50MB 3.6 4.3 13.7 12.8
resident file /dev/null 50MB 3.6 0.8 4.1 11.5
repeat above /dev/null 50MB 3.6 0.8 0.7 4.5
repeat above /dev/null 50MB 3.6 0.8 0.7 0.8
repeat above /dev/null 50MB 3.6 0.8 0.7 0.8