aboutsummaryrefslogtreecommitdiff
path: root/kern/startup.c
diff options
context:
space:
mode:
authorDamien Zammit <damien@zamaudio.com>2023-09-24 10:35:10 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-09-24 14:38:03 +0200
commitb11e10e2c81c2b608176021364a36d84173358e3 (patch)
tree8bde3f47151865143341e864040af3bde68385a5 /kern/startup.c
parent31d45d0d8ee1d8eee96fc2a283a388b6b6aca669 (diff)
downloadgnumach-b11e10e2c81c2b608176021364a36d84173358e3.tar.gz
gnumach-b11e10e2c81c2b608176021364a36d84173358e3.tar.bz2
gnumach-b11e10e2c81c2b608176021364a36d84173358e3.zip
percpu area using gs segment
This speeds up smp again, by storing the struct processor in a percpu area and avoiding an expensive cpu_number every call of current_processor(), as well as getting the cpu_number by an offset into the percpu area. Untested on 64 bit and work remains to use other percpu arrays. TESTED: (NCPUS=8) -smp 1 boots to login shell ~2x slower than uniprocessor TESTED: (NCPUS=8) -smp 2 boots to INIT but hangs there TESTED: (NCPUS=8) -smp 4 gets stuck seemingly within rumpdisk and hangs TESTED: (NCPUS=1) uniprocessor is a bit faster than normal Message-Id: <20230924103428.455966-3-damien@zamaudio.com>
Diffstat (limited to 'kern/startup.c')
-rw-r--r--kern/startup.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kern/startup.c b/kern/startup.c
index 2eb3a739..88608c7d 100644
--- a/kern/startup.c
+++ b/kern/startup.c
@@ -74,6 +74,7 @@ boolean_t reboot_on_panic = TRUE;
#if NCPUS > 1
#include <machine/mp_desc.h>
+#include <kern/smp.h>
#include <kern/machine.h>
#endif /* NCPUS > 1 */
@@ -281,7 +282,7 @@ void cpu_launch_first_thread(thread_t th)
{
int mycpu;
- mycpu = cpu_number();
+ mycpu = cpu_number_slow();
cpu_up(mycpu);