SMP - Balancing run queues for SMP

- it preempts running processes though :( this is not the final
  solution
This commit is contained in:
Tomas Hruby
2010-09-15 14:10:51 +00:00
parent 06b6e5624a
commit 311f145bc7
2 changed files with 53 additions and 17 deletions

View File

@@ -662,11 +662,14 @@ PUBLIC int sched_proc(struct proc *p,
/* FIXME this is a problem for SMP if the processes currently runs on a
* different CPU */
if (proc_is_runnable(p) && p->p_cpu != cpuid &&
(cpu != -1 || cpu != p->p_cpu)) {
printf("WARNING : changing cpu of a runnable process %d "
"on a different cpu!\n", p->p_endpoint);
return(EINVAL);
if (proc_is_runnable(p)) {
if (p->p_cpu != cpuid && cpu != -1 && cpu != p->p_cpu) {
printf("WARNING : changing cpu of a runnable process %d "
"on a different cpu!\n", p->p_endpoint);
return(EINVAL);
}
RTS_SET(p, RTS_NO_QUANTUM);
}
if (proc_is_runnable(p))