obtain_clone_cpuid(): respect parent's CPU set

This commit is contained in:
Balazs Gerofi
2016-12-08 16:01:30 +09:00
parent 61fc4c5e55
commit 3cecafac59
3 changed files with 32 additions and 65 deletions

View File

@@ -579,14 +579,16 @@ static int syscall_packet_handler(struct ihk_ikc_channel_desc *c,
break;
case SCD_MSG_SCHEDULE_PROCESS:
cpuid = obtain_clone_cpuid();
if(cpuid == -1){
thread = (struct thread *)packet->arg;
cpuid = obtain_clone_cpuid(&thread->cpu_set);
if (cpuid == -1) {
kprintf("No CPU available\n");
ret = -1;
break;
}
dkprintf("SCD_MSG_SCHEDULE_PROCESS: %lx\n", packet->arg);
thread = (struct thread *)packet->arg;
proc = thread->proc;
thread->tid = proc->pid;
proc->status = PS_RUNNING;
@@ -594,8 +596,7 @@ static int syscall_packet_handler(struct ihk_ikc_channel_desc *c,
chain_thread(thread);
chain_process(proc);
runq_add_thread(thread, cpuid);
//cpu_local_var(next) = (struct thread *)packet->arg;
ret = 0;
break;

View File

@@ -2039,7 +2039,7 @@ unsigned long do_fork(int clone_flags, unsigned long newsp,
return -EINVAL;
}
cpuid = obtain_clone_cpuid();
cpuid = obtain_clone_cpuid(&old->cpu_set);
if (cpuid == -1) {
kprintf("do_fork,core not available\n");
return -EAGAIN;