[[!meta copyright="Copyright © 2012, 2013 Free Software Foundation, Inc."]] [[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable id="license" text="Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled [[GNU Free Documentation License|/fdl]]."]]"""]] [[!meta title="SMP"]] [[!tag open_issue_glibc open_issue_gnumach open_issue_hurd]] 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. [[!img images/smp.svg size="700x"]] # 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|https://www.gnu.org/software/hurd/hurd/running/qemu.html]]. 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|https://lists.gnu.org/archive/html/bug-hurd/2024-02/msg00088.html]]. ## References - [Comments about the project bug-hurd maillist](https://lists.gnu.org/archive/html/bug-hurd/2018-08/msg00048.html) - [Initial thread in bug-hurd maillist](https://lists.gnu.org/archive/html/bug-hurd/2018-06/msg00048.html) - [SMP in GNU/Hurd FAQ](https://www.gnu.org/software/hurd/faq/smp.html) - [GNU Mach git repository](https://git.savannah.gnu.org/cgit/hurd/gnumach.git) - [GNU Mach reference manual](https://www.gnu.org/software/hurd/gnumach-doc/) - [**MultiProcessor Specification**](https://pdos.csail.mit.edu/6.828/2011/readings/ia32/MPspec.pdf) - [**ACPI Specification**](http://www.uefi.org/sites/default/files/resources/ACPI%206_2_A_Sept29.pdf) - [Mach boot trace](https://www.gnu.org/software/hurd/microkernel/mach/gnumach/boot_trace.html) - [SPL man page](https://man.openbsd.org/spl) - [Book: The Mach System](http://codex.cs.yale.edu/avi/os-book/OS9/appendices-dir/b.pdf) - [Book: Mach3 Mysteries](http://www.nv50.0fees.net/Doc/Mach3Mysteries.pdf) - [X15 operating system](https://www.sceen.net/x15) - [Symmetric Multiprocessing - OSDev Wiki](https://wiki.osdev.org/Symmetric_Multiprocessing) - [**Intel® 64 and IA-32 Architectures Software Developer’s Manuals**](https://software.intel.com/sites/default/files/managed/39/c5/325462-sdm-vol-1-2abcd-3abcd.pdf) - [**Intel Developer Guide, Volume 3: System Programming Guide**](https://software.intel.com/sites/default/files/managed/a4/60/325384-sdm-vol-3abcd.pdf) See also the [[FAQ entry|faq/smp]].