summaryrefslogtreecommitdiff
path: root/sys/src/9/pc
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2016-01-11 06:47:52 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2016-01-11 06:47:52 +0100
commit63f9a4fda36f916e543c8f3ea117b31c194a4db7 (patch)
treeac839d913108b0f5c8ccf08428ad43392cbe4f4b /sys/src/9/pc
parentdacaf31eb02fb7bb997d844a62694f854ca9616b (diff)
pc/pc64: bring up ap's one after another, use idlehands() while waiting for thunderbirdsarego
when testing in qemu, launching each ap became slower and slower because all the ap's where spinning in syncclock() waiting for cpu0 to update its mach0->tscticks, which happens only much later after all cpu's have been started up. now we wait for each cpu to do its timer callibration and manually update our tscticks while we wait and each cpu will not spin but halt while waiting for active.thunderbirdsarego. this reduces the system load and noise for timer callibration and makes the mp startup linear with regard to the number of cores.
Diffstat (limited to 'sys/src/9/pc')
-rw-r--r--sys/src/9/pc/devarch.c1
-rw-r--r--sys/src/9/pc/mp.c15
-rw-r--r--sys/src/9/pc/squidboy.c2
3 files changed, 13 insertions, 5 deletions
diff --git a/sys/src/9/pc/devarch.c b/sys/src/9/pc/devarch.c
index d3ead0cac..f3be061cb 100644
--- a/sys/src/9/pc/devarch.c
+++ b/sys/src/9/pc/devarch.c
@@ -783,7 +783,6 @@ cpuidentify(void)
wrmsr(0x10, 0);
}
-
/*
* use i8253 to guess our cpu speed
*/
diff --git a/sys/src/9/pc/mp.c b/sys/src/9/pc/mp.c
index e937c9391..ba341c5ca 100644
--- a/sys/src/9/pc/mp.c
+++ b/sys/src/9/pc/mp.c
@@ -196,9 +196,7 @@ mpinit(void)
ncpu = MAXMACH;
memmove((void*)APBOOTSTRAP, apbootstrap, sizeof(apbootstrap));
for(i=0; i<nelem(mpapic); i++){
- if((apic = mpapic[i]) == nil)
- continue;
- if(apic->machno >= MAXMACH)
+ if((apic = mpapic[i]) == nil || apic->machno == 0 || apic->machno >= MAXMACH)
continue;
if(ncpu <= 1)
break;
@@ -206,6 +204,17 @@ mpinit(void)
mpstartap(apic);
conf.nmach++;
ncpu--;
+
+ if(!apic->online){
+ print("LAPIC%d: cpu%d did not startup\n", i, apic->machno);
+ continue;
+ }
+
+ /* update tscticks for ap's syncclock() */
+ while(!active.machs[apic->machno]){
+ if(arch->fastclock == tscticks)
+ cycles(&m->tscticks);
+ }
}
}
diff --git a/sys/src/9/pc/squidboy.c b/sys/src/9/pc/squidboy.c
index 85c3992d1..5b10ea211 100644
--- a/sys/src/9/pc/squidboy.c
+++ b/sys/src/9/pc/squidboy.c
@@ -34,7 +34,7 @@ squidboy(Apic* apic)
unlock(&active);
while(!active.thunderbirdsarego)
- microdelay(100);
+ idlehands();
schedinit();
}