Return error when no core is available

clone returns -EAGAIN when there is no vacant core.
In addition, clone tries to use the next vacant hyper-threading
core instead of trying to use next vacant hyper-threading core
of the next vacant physical core.
This commit is contained in:
Masamichi Takagi
2014-07-31 19:45:11 +09:00
parent 0dd7a8deff
commit 6dd5407b5f
2 changed files with 20 additions and 7 deletions

View File

@ -1290,6 +1290,9 @@ SYSCALL_DECLARE(clone)
(unsigned long)ihk_mc_syscall_sp(ctx));
cpuid = obtain_clone_cpuid();
if (cpuid == -1) {
return -EAGAIN;
}
new = clone_process(cpu_local_var(current), ihk_mc_syscall_pc(ctx),
ihk_mc_syscall_arg1(ctx) ? ihk_mc_syscall_arg1(ctx) :