SMP stands for Symmetric multiprocessing, which is a computer that has numerous identical processors connected to a single shared main memory. All processors are controlled by one single operating system, and each processor can access all devices. Operating systems with SMP can provide more performance, but it is not trivial to do so. It is a little like having a packed board meeting. More people in the room potentially means more can get done, but only one person can speak at a time. Scheduling everyone to speak can be quite an involved task.
NOTE: Many of the veteran Hurd developers consider this task too large for a Google summer of code project.
Current Status
As of September 2024, the SMP support is implemented for i386 with working internet, because it boots with only one cpu in the default processor set. The slave processors are temporarily disabled until they can be safely used per task. We are unable to turn on the full set at boot time due to race bugs. Debian Hurd provides SMP enabled GNU Mach kernels.
How to test the current SMP support
The easiest way to test the SMP support, is via the qemu guide. Once you have the Hurd running you can build an SMP enabled GNU Mach.
$ git clone git://git.savannah.gnu.org/hurd/gnumach.git
$ cd gnumach
$ autoreconf -i
$ mkdir build
$ cd build
$ ../configure --enable-ncpus=4 --enable-kdb
$ make gnumach.gz
$ su
# mv /boot/gnumach-1.8-486.gz /boot/gnumach-1.8-486.gz.bak
# cp gnumach.gz /boot/gnumach-1.8-486.gz
You may optionally update /boot/grub/grub.cfg change hd0 to wd0
and add console=com0
/boot/gnumach-1.8-486.gz root=part:2:device:wd0 console=com0
update /etc/fstab and update wd0 instead of hd0.
/dev/wd0s2 / ext2 defaults 0 1
/dev/wd0s1 none swap sw 0 0
You can shutdown via /sbin/poweroff.
start qemu with -smp 4 and add -nographic if you want to use com0.
$ qemu-system-i386 -M q35,accel=kvm -smp 4 -m 2G -net \
user,hostfwd=tcp::2223-:22 -net nic -hda debian-hurd-VERSION.img \
-nographic
To test smp:
$ sudo /path/to/smp /bin/bash
$ stress -c 7
smp.c source can be found here.
References
- Comments about the project bug-hurd maillist
- Initial thread in bug-hurd maillist
- SMP in GNU/Hurd FAQ
- GNU Mach git repository
- GNU Mach reference manual
- MultiProcessor Specification
- ACPI Specification
- Mach boot trace
- SPL man page
- Book: The Mach System
- Book: Mach3 Mysteries
- X15 operating system
- Symmetric Multiprocessing - OSDev Wiki
- Intel® 64 and IA-32 Architectures Software Developer’s Manuals
- Intel Developer Guide, Volume 3: System Programming Guide
See also the FAQ entry.
