diff --git a/executer/user/mcexec.c b/executer/user/mcexec.c index 9c78e2a6..acae1f8b 100644 --- a/executer/user/mcexec.c +++ b/executer/user/mcexec.c @@ -2646,7 +2646,7 @@ int main(int argc, char **argv) } /* Partitioned execution, obtain CPU set */ - if (nr_processes > 0) { + if (!target_core && nr_processes > 0) { struct get_cpu_set_arg cpu_set_arg; int mcexec_linux_numa = 0; int ikc_mapped = 0; diff --git a/kernel/host.c b/kernel/host.c index 7241307e..521f3fdd 100644 --- a/kernel/host.c +++ b/kernel/host.c @@ -758,11 +758,14 @@ static int syscall_packet_handler(struct ihk_ikc_channel_desc *c, case SCD_MSG_SCHEDULE_PROCESS: thread = (struct thread *)packet->arg; - cpuid = obtain_clone_cpuid(&thread->cpu_set, 0); - if (cpuid == -1) { - kprintf("No CPU available\n"); - ret = -1; - break; + cpuid = ihk_mc_get_processor_id(); + if (!CPU_ISSET(cpuid, &thread->cpu_set)) { + cpuid = obtain_clone_cpuid(&thread->cpu_set, 0); + if (cpuid == -1) { + kprintf("No CPU available\n"); + ret = -1; + break; + } } dkprintf("SCD_MSG_SCHEDULE_PROCESS: %lx\n", packet->arg);