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:
@@ -215,8 +215,12 @@ PRIVATE void ap_finish_booting(void)
|
||||
}
|
||||
printf("CPU %d local APIC timer is ticking\n", cpu);
|
||||
|
||||
/* FIXME assign CPU local idle structure */
|
||||
get_cpulocal_var(proc_ptr) = proc_addr(IDLE);
|
||||
get_cpulocal_var(bill_ptr) = proc_addr(IDLE);
|
||||
|
||||
BKL_UNLOCK();
|
||||
|
||||
|
||||
ap_boot_finished(cpu);
|
||||
spinlock_unlock(&boot_lock);
|
||||
for(;;);
|
||||
|
||||
@@ -370,19 +370,38 @@ PUBLIC void do_ser_debug()
|
||||
ser_debug(c);
|
||||
}
|
||||
|
||||
PRIVATE void ser_dump_queues(void)
|
||||
PRIVATE void ser_dump_queue_cpu(unsigned cpu)
|
||||
{
|
||||
int q;
|
||||
struct proc ** rdy_head;
|
||||
|
||||
rdy_head = get_cpu_var(cpu, run_q_head);
|
||||
|
||||
for(q = 0; q < NR_SCHED_QUEUES; q++) {
|
||||
struct proc *p;
|
||||
if(rdy_head[q])
|
||||
if(rdy_head[q]) {
|
||||
printf("%2d: ", q);
|
||||
for(p = rdy_head[q]; p; p = p->p_nextready) {
|
||||
printf("%s / %d ", p->p_name, p->p_endpoint);
|
||||
for(p = rdy_head[q]; p; p = p->p_nextready) {
|
||||
printf("%s / %d ", p->p_name, p->p_endpoint);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
|
||||
PRIVATE void ser_dump_queues(void)
|
||||
{
|
||||
#ifdef CONFIG_SMP
|
||||
unsigned cpu;
|
||||
|
||||
printf("--- run queues ---\n");
|
||||
for (cpu = 0; cpu < ncpus; cpu++) {
|
||||
printf("CPU %d :\n", cpu);
|
||||
ser_dump_queue_cpu(cpu);
|
||||
}
|
||||
#else
|
||||
ser_dump_queue_cpu(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
PRIVATE void ser_dump_segs(void)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define __GLO_X86_H__
|
||||
|
||||
#include "kernel/kernel.h"
|
||||
#include "proto.h"
|
||||
#include "arch_proto.h"
|
||||
|
||||
EXTERN int cpu_has_tsc; /* signal whether this cpu has time stamp register. This
|
||||
feature was introduced by Pentium */
|
||||
|
||||
Reference in New Issue
Block a user