sched_setaffinity(): respect process cpu_set

This commit is contained in:
Balazs Gerofi
2017-02-09 17:11:17 +09:00
parent dfb0a37305
commit 610463ff39
3 changed files with 34 additions and 21 deletions

View File

@ -281,6 +281,7 @@ struct thread *create_thread(unsigned long user_pc,
dkprintf("%s: pid: %d, CPU: %d\n",
__FUNCTION__, proc->pid, cpu);
CPU_SET(cpu, &thread->cpu_set);
CPU_SET(cpu, &proc->cpu_set);
cpu_set_empty = 0;
}
@ -292,6 +293,7 @@ struct thread *create_thread(unsigned long user_pc,
infop = ihk_mc_get_cpu_info();
for (i = 0; i < infop->ncpus; ++i) {
CPU_SET(i, &thread->cpu_set);
CPU_SET(i, &proc->cpu_set);
}
}