Things look quiet here. But I've been doing a lot of blogging at
dan.langille.org because I prefer WordPress now.
Not all my posts there are FreeBSD related.
I am in the midst of migrating The FreeBSD Diary over to WordPress
(and you can read about that here).
Once the migration is completed, I'll move the FreeBSD posts into the
new FreeBSD Diary website.
This rather short article is all about adding SMP to your kernel.
Technically, SMP is symmetric
multiprocessing. Practically, it means having more than one CPU. Such
machines are faster than single CPU machines.
In this article, I will assume you have a
dual-cpu box. It's not hard to expand this section to apply to more CPUs, but I'm
not going to guess at exactly how that is done.
FreeBSD, by default, does not have SMP enable in the kernel. This means that
FreeBSD sees only the first CPU. In order to enable the other CPU[s], you need to
create a new kernel. For instructions on how to create a new kernel, refer to the Configuring the FreeBSD Kernel
section in the FreeBSD handbook. Pay
special attention to the section on Building and Installing
a Custom Kernel.
I created my new kernel, using the above instructions, by searching for SMP within my
kernel configuration file. I found this:
# To make an SMP kernel, the next two are needed
options SMP # Symmetric MultiProcessor Kernel
options APIC_IO # Symmetric (APIC) I/O
Those are the only options I added to my kernel. No other changes where made.
For the record, the make took about 8 minutes, I think. Not sure. I wasn't
timing it properly.
Verifying that SMP is working
Here's what you should see near the end of your dmesg output:
SMP: AP CPU #1 Launched!
That's your second CPU.
Also, if you look at top, you'll see a new column (C), which indicates which
CPU a particluar process is running on: