uti: util_indicate_clone: check --enable-uti mcexec option
Change-Id: Ic7474d01c18acd1edbc07844d7a7b010b2175f71
This commit is contained in:
@ -164,6 +164,7 @@ struct program_load_desc {
|
||||
(sizeof(unsigned long) * 8)];
|
||||
|
||||
int thp_disable;
|
||||
int enable_uti;
|
||||
int uti_thread_rank; /* N-th clone() spawns a thread on Linux CPU */
|
||||
int uti_use_last_cpu; /* Work-around not to share CPU with OpenMP thread */
|
||||
int straight_map;
|
||||
|
||||
@ -2816,6 +2816,7 @@ int main(int argc, char **argv)
|
||||
desc->mpol_mode, desc->mpol_nodemask[0]);
|
||||
}
|
||||
|
||||
desc->enable_uti = enable_uti;
|
||||
desc->uti_thread_rank = uti_thread_rank;
|
||||
desc->uti_use_last_cpu = uti_use_last_cpu;
|
||||
desc->thp_disable = get_thp_disable();
|
||||
|
||||
@ -563,6 +563,7 @@ static int process_msg_prepare_process(unsigned long rphys)
|
||||
__func__, vm->numa_mem_policy, vm->numa_mask[0]);
|
||||
}
|
||||
|
||||
proc->enable_uti = pn->enable_uti;
|
||||
proc->uti_thread_rank = pn->uti_thread_rank;
|
||||
proc->uti_use_last_cpu = pn->uti_use_last_cpu;
|
||||
|
||||
|
||||
@ -565,6 +565,7 @@ struct process {
|
||||
unsigned long mpol_bind_mask;
|
||||
int mpol_mode;
|
||||
|
||||
int enable_uti;
|
||||
int uti_thread_rank; /* Spawn on Linux CPU when clone_count reaches this */
|
||||
int uti_use_last_cpu; /* Work-around not to share CPU with OpenMP thread */
|
||||
int clone_count;
|
||||
|
||||
@ -235,6 +235,7 @@ struct program_load_desc {
|
||||
(sizeof(unsigned long) * 8)];
|
||||
|
||||
int thp_disable;
|
||||
int enable_uti;
|
||||
int uti_thread_rank; /* N-th clone() spawns a thread on Linux CPU */
|
||||
int uti_use_last_cpu; /* Work-around not to share CPU with OpenMP thread */
|
||||
int straight_map;
|
||||
|
||||
@ -122,6 +122,7 @@ init_process(struct process *proc, struct process *parent)
|
||||
sizeof(struct rlimit) * MCK_RLIM_MAX);
|
||||
memcpy(&proc->cpu_set, &parent->cpu_set,
|
||||
sizeof(proc->cpu_set));
|
||||
proc->enable_uti = parent->enable_uti;
|
||||
}
|
||||
|
||||
INIT_LIST_HEAD(&proc->hash_list);
|
||||
|
||||
@ -10722,6 +10722,12 @@ SYSCALL_DECLARE(util_indicate_clone)
|
||||
struct thread *thread = cpu_local_var(current);
|
||||
struct uti_attr *kattr = NULL;
|
||||
|
||||
if (!thread->proc->enable_uti) {
|
||||
kprintf("%s: error: --enable-uti mcexec option not specified\n",
|
||||
__func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (mod != SPAWN_TO_LOCAL &&
|
||||
mod != SPAWN_TO_REMOTE)
|
||||
return -EINVAL;
|
||||
|
||||
Reference in New Issue
Block a user