hubertf's NetBSD Blog
Send interesting links to hubert at feyrer dot de!
 
[20090112] More kernel tuning in progress
Andrew Doran is at it again, and he has proposed a number of patches to further improve NetBSD's performance in various areas:

  • Optimization for exec by using a cached copy of the file's exec header, and reducing locking-overhead by keeping locks instead of freeing them and the immediately re-locking them.

  • The NetBSD kernel offers a few internal interfaces for allocating memory, depending on use of the memory, duration of use, size, etc. For some of the proper SMP-handling is important, and thus the number of CPUs has an impact on their performance. By adding caching, this can be mitigated to get linear behaviour, independent from the number of CPUs:

  • The openat() and fstatat() system calls are not available in NetBSD yet, but other systems offer them, standards are about to pick them up, and ZFS assumes their presence. The system calls offer a way to way to specify a different directory to which relative paths are relative to, other than ".", by passing a file descriptor for that directory. Now there is a patch to add openat() and fstatat() to NetBSD.

  • In theory, pipes are just a special case of (host-local) sockets, but it makes sense to keep a separate implementation for reasons of speed optimizations. NetBSD has the "PIPE_SOCKETPAIR" kernel option to force use of the socket code for pipes in order to reduce the memory footprint, but benchmarks reflect the performace hit. In order to improve the the situation, a number of improvements are under way, including better cache utilization and SMP-compliant memory allocation over homegrown memory management.

  • Improved performance of exit(2) - this is important in environments with many short-running processes (think httpd, inetd).

  • As a final step, freeing entries in the translation lookaside buffer (TLB) of the x86 (i386, amd64, xen) memory management unit AKA TLB shootdown were sped up to a point where TLB shootdown interrupts are 50% down during a system rebuild on an 8-cpu machine, and several million(!) calls page invalidation were optimized away, resulting in a 1% speed increase on the overall build.

  • A partial(!) port of Sun's ZFS is also made available. It's not at the state where it can be used, but should be a good starting point for an experienced kernel hacker to continue working. See Andrew's mail to tech-kern for further directions.


[Tags: , , ]


Disclaimer: All opinion expressed here is purely my own. No responsibility is taken for anything.

Access count: 36116059
Copyright (c) Hubert Feyrer