LWN.net Logo

FreeBSD 8: an evolutionary release of the unknown giant

December 9, 2009

This article was contributed by Koen Vervloesem

FreeBSD 8.0 is a major release of the free UNIX descendant. Support for ZFS, jails and USB have been improved, but the release also adds new features, such as NFSv4 and Xen DomU support and some new kernel-related tools. The release notes detail these and other changes that appear in the latest FreeBSD.

New kernel tools

The new textdump feature comes in handy when debugging kernel panics, as it extracts commonly needed information from the kernel memory dump. Textdump stores human-readable text files into a tar archive, and those files can then be analyzed without access to kernel source and symbols. The textdump files are also appropriate for filing a bug report. By default, kernel dumps are still generated in the machine-readable binary format, but by setting the debug.ddb.textdump.pending sysctl variable to 1 using sysctl, the next dump will be a textdump.

Another interesting utility is procstat, which displays detailed information about running processes, such as command line arguments, virtual memory mappings, thread information, file descriptor information, etcetera. FreeBSD 8 also supports Sun's DTrace (introduced in release 7.1), a dynamic tracing framework to assist in profiling the operating system and applications, e.g. to find performance bottlenecks.

FreeBSD 8's network stack has been optimized with a per-CPU flow cache, which increases network throughput on multi core systems, and improvements in the scalability of UDP and TCP. The wireless networking stack has been extended with the "Virtual Access Points (VAP)" functionality, which lets administrators define multiple wireless networks to be hosted from a single access point. This allows for example one wireless network with WPA2 encryption for access to the local network and one without encryption for basic network access for visitors. FreeBSD 8 also supports draft 802.11s mesh networks.

File systems

On the file system front, NFSv4 support has been added (both client and server side), although it is still experimental. Thanks to NFSv4, users can have better security access controls and performance improvements. NFSv4 ACL support is not yet complete: libc changes and some of the kernel changes are part of FreeBSD 8.0, but user space utilities and support for the access control lists in ZFS are expected in FreeBSD 8.1.

The ZFS file system has been upgraded from version 6 to version 13 and is deemed production ready. Also, because ZFS requires a large amount of kernel memory, the limit of kernel memory that could be allocated in FreeBSD has been increased from 2 GB to 512 GB. Two GB was a bit cramped for Sun's file system, which tends to use as much kernel memory as it can. ZFS is not recommended for 32-bit architectures: the ZFS Tuning Guide for FreeBSD reads "A 64-bit system is preferred due to its larger address space and better performance on 64bit variables, which are used extensively by ZFS. 32-bit systems are supported though, with sufficient tuning."

Virtualization

Since FreeBSD 7.2, it has been possible to assign multiple IPv4 or IPv6 addresses to a FreeBSD jail. Jails can now also be restricted to certain CPUs and they can be nested hierarchically. A child jail is always at least as restricted as its ancestors.

Another (experimental) virtualization improvement is VImage, a network virtualization system. This makes it possible to give jails their own independent packet filters and routing tables. All these features open new possibilities for FreeBSD hosting services, who use jails a lot. For example, a web server in a jail can now be assigned multiple addresses and offer virtual hosting, customers can create jails inside their own jail to secure their services, and they can use their own firewall.

The developers have also integrated experimental Xen DomU support into FreeBSD, allowing it to be used as a 32-bit guest operating system on a Xen 3.1 or higher Dom0 host. This will eventually make it possible to use FreeBSD on Amazon EC2 (which at the moment uses Xen 3.0.3). Moreover, the open source edition of VirtualBox has also been ported to FreeBSD (emulators/virtualbox in the ports collection).

Desktop

FreeBSD focuses on the server, but it can also be used as a desktop system, although its descendant PC-BSD (8.0 now in alpha release) is better suited for this purpose. The GNOME desktop environment has been updated to version 2.26.3 (x11/gnome2), and KDE to 4.3.1 (x11/kde4). In previous versions, removing a USB storage device without unmounting its file system first resulted in a kernel panic, crashing the operating system. Release 8.0 adds USB storage hot plug functionality. For desktop users, this is a visible improvement of their user experience, giving FreeBSD the stability it needs on the desktop. Under the hood, the USB stack received a significant overhaul, fixing many long standing problems.

For users that compile their software from the FreeBSD ports collection (with around 20,000 packages that can be compiled from source), there is a simple but very effective new feature. If the hardware has a multi core processor, individual software will be built in parallel on all available cores by default. This is achieved by passing the -jX flag to make, with X the number of cores in the machine. The user can override this number with MAKE_JOBS_NUMBER in /etc/make.conf. Not all software supports this, but the most popular ports do, which speeds up compilation considerably.

One thing that hasn't changed a lot (again) is the installation utility, sysinstall. Its man page even reads "This product is currently at the end of its life cycle and will eventually be replaced". However, currently there are no signs of a replacement utility. One domain where sysinstall fails is that it doesn't support ZFS yet. As a consequence, installing a ZFS-only FreeBSD system requires a lot of manual steps.

For developers

Because the GCC compiler suite was relicensed to GPLv3 after the 4.2 release, commercial users of FreeBSD have been looking into compilers with a more liberal license. One promising project is the Clang/LLVM combination, which is a BSD-licensed C/C++ compiler suite. So the FreeBSD project is intending to use Clang/LLVM as the default compiler for the base system. This is a work in progress, and Clang/LLVM will not likely replace GCC for all third party software, because many depend on GCC-specific constructs.

Last month, FreeBSD 8 also saw the addition of Grand Central Dispatch, Apple's solution for automatic thread pool management in Mac OS 10.6 ("Snow Leopard"). The FreeBSD wiki lists the status of the GCD port and some references to give it a try. Incidentally, both Clang/LLVM and Grand Central Dispatch are backed by Apple, making the Cupertino-based company an important contributor to the future of FreeBSD.

Conclusion

It is difficult to pinpoint one unique area were FreeBSD 8 shines. The release shows improvements in a lot of areas. From kernel programmers and file system lovers to developers, administrators and even end-users, everyone will find something new. From the standpoint of a Linux user, one could ask why someone might want to choose FreeBSD over Linux. This is largely a matter of taste, but your author likes the clean FreeBSD ports system which even allows you to select build options, the excellent hands-on documentation in the FreeBSD Handbook and the quality of the man pages.


(Log in to post comments)

Xen?

Posted Dec 10, 2009 4:29 UTC (Thu) by ncm (subscriber, #165) [Link]

I'm curious about their integrating Xen at the same time as Linux seems to
be abandoning it. Should we assume that FreeBSD runs as a guest under KVM
with no adaptions needed?

Xen?

Posted Dec 10, 2009 6:34 UTC (Thu) by ptman (subscriber, #57271) [Link]

Seems to work: http://www.linux-kvm.org/page/Guest_Support_Status
But apparently still untested for 8.0

Xen?

Posted Dec 10, 2009 7:10 UTC (Thu) by drag (subscriber, #31333) [Link]

Xen requires kernel modifications in the guest operating system in order to
take advantage of 'paravirtualization', which has dramatic speed
improvements.

KVM does not use this approach and does 'full virtualization' with the
assistance of hardware virtualization features. This allows operating
systems to run as guests unmodified. (Xen can go full virt with similar
hardware support)

Xen?

Posted Dec 10, 2009 20:23 UTC (Thu) by elanthis (guest, #6227) [Link]

Correct me if I'm wrong, but KVM allows paravittualizatuon as well, for guests that support
it's interface, letting it achieve similar performance to xen for (currently) Linux guests.

Windows paravirt guests under kvm

Posted Dec 11, 2009 15:51 UTC (Fri) by mcmanus (subscriber, #4569) [Link]

You can run paravirt network and block i/o on windows guests (as well as the aforementioned linux guests) under kvm hosts if you like: http://www.linux-kvm.org/page/WindowsGuestDrivers/Downloa...

Xen?

Posted Dec 11, 2009 15:55 UTC (Fri) by gnb (subscriber, #5132) [Link]

Yes, you can use paravirtualised device drivers in KVM to avoid the I/O
performance hit of emulated I/O hardware for things like networking and
disks. That said the guest kernel is unmodified, so it won't run at all
without CPU virtualisation support, and some aspects of kernel performance
will be very dependent on how good the implementation of said support is in
the CPU you're using.

new "FixIt" shell included on install media

Posted Dec 10, 2009 9:28 UTC (Thu) by jabby (guest, #2648) [Link]

Another major improvement is the inclusion of the 'FixIt' shell in the install media. This is quite handy in allowing one to rescue a broken system.

FreeBSD 8: an evolutionary release of the unknown giant

Posted Dec 12, 2009 14:05 UTC (Sat) by eparis123 (guest, #59739) [Link]

... and the quality of the man pages.
The best manpages I found in terms of quality and clearness was Solaris manpages.

Copyright © 2009, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds