SMP - CPU local run queues

- each CPU has its own runqueues

- processes on BSP are put on the runqueues later after a switch to
  the final stack when cpuid works to avoid special cases

- enqueue() and dequeue() use the run queues of the cpu the process is
  assigned to

- pick_proc() uses the local run queues

- printing of per-CPU run queues ('2') on serial console
This commit is contained in:
Tomas Hruby
2010-09-15 14:10:18 +00:00
parent ad73a4f50c
commit fac5fbfdbf
10 changed files with 134 additions and 60 deletions

View File

@@ -194,6 +194,7 @@ PRIVATE void load_update(void)
u16_t slot;
int enqueued = 0, q;
struct proc *p;
struct proc **rdy_head;
/* Load average data is stored as a list of numbers in a circular
* buffer. Each slot accumulates _LOAD_UNIT_SECS of samples of
@@ -207,6 +208,7 @@ PRIVATE void load_update(void)
kloadinfo.proc_last_slot = slot;
}
rdy_head = get_cpulocal_var(run_q_head);
/* Cumulation. How many processes are ready now? */
for(q = 0; q < NR_SCHED_QUEUES; q++) {
for(p = rdy_head[q]; p != NULL; p = p->p_nextready) {