partitioned execution: pass process rank to LWK
Cherry-pick of d2d134d5e6a4b16a34d55d31b14614a2a91ecf47 Conflicts: kernel/include/process.h
This commit is contained in:
@ -91,6 +91,7 @@ struct program_image_section {
|
|||||||
|
|
||||||
struct get_cpu_set_arg {
|
struct get_cpu_set_arg {
|
||||||
int nr_processes;
|
int nr_processes;
|
||||||
|
int *process_rank;
|
||||||
void *cpu_set;
|
void *cpu_set;
|
||||||
size_t cpu_set_size; // Size in bytes
|
size_t cpu_set_size; // Size in bytes
|
||||||
int *target_core;
|
int *target_core;
|
||||||
@ -143,6 +144,7 @@ struct program_load_desc {
|
|||||||
long stack_premap;
|
long stack_premap;
|
||||||
unsigned long mpol_bind_mask;
|
unsigned long mpol_bind_mask;
|
||||||
int nr_processes;
|
int nr_processes;
|
||||||
|
int process_rank;
|
||||||
char shell_path[SHELL_PATH_MAX_LEN];
|
char shell_path[SHELL_PATH_MAX_LEN];
|
||||||
__cpu_set_unit cpu_set[PLD_CPU_SET_SIZE];
|
__cpu_set_unit cpu_set[PLD_CPU_SET_SIZE];
|
||||||
int profile;
|
int profile;
|
||||||
|
|||||||
@ -692,6 +692,7 @@ static long mcexec_get_cpuset(ihk_os_t os, unsigned long arg)
|
|||||||
wake_up_interruptible(&pli_next->pli_wq);
|
wake_up_interruptible(&pli_next->pli_wq);
|
||||||
/* Reset process counter */
|
/* Reset process counter */
|
||||||
pe->nr_processes_left = pe->nr_processes;
|
pe->nr_processes_left = pe->nr_processes;
|
||||||
|
pe->process_rank = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Wait for the rest if not the last or if the last but
|
/* Wait for the rest if not the last or if the last but
|
||||||
@ -923,6 +924,15 @@ next_cpu:
|
|||||||
goto put_and_unlock_out;
|
goto put_and_unlock_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Copy rank */
|
||||||
|
if (copy_to_user(req.process_rank, &pe->process_rank,
|
||||||
|
sizeof(int))) {
|
||||||
|
printk("%s: error copying process rank to user\n",
|
||||||
|
__FUNCTION__);
|
||||||
|
ret = -EINVAL;
|
||||||
|
goto put_and_unlock_out;
|
||||||
|
}
|
||||||
|
|
||||||
/* mcexec NUMA to bind to */
|
/* mcexec NUMA to bind to */
|
||||||
mcexec_linux_numa = cpu_to_node(mckernel_cpu_2_linux_cpu(udp, cpu));
|
mcexec_linux_numa = cpu_to_node(mckernel_cpu_2_linux_cpu(udp, cpu));
|
||||||
if (copy_to_user(req.mcexec_linux_numa, &mcexec_linux_numa,
|
if (copy_to_user(req.mcexec_linux_numa, &mcexec_linux_numa,
|
||||||
@ -970,6 +980,7 @@ next_cpu:
|
|||||||
}
|
}
|
||||||
/* Otherwise wake up next process in list */
|
/* Otherwise wake up next process in list */
|
||||||
else {
|
else {
|
||||||
|
++pe->process_rank;
|
||||||
pli_next = list_first_entry(&pe->pli_list,
|
pli_next = list_first_entry(&pe->pli_list,
|
||||||
struct process_list_item, list);
|
struct process_list_item, list);
|
||||||
list_del(&pli_next->list);
|
list_del(&pli_next->list);
|
||||||
|
|||||||
@ -314,6 +314,7 @@ struct mcctrl_part_exec {
|
|||||||
struct mutex lock;
|
struct mutex lock;
|
||||||
int nr_processes;
|
int nr_processes;
|
||||||
int nr_processes_left;
|
int nr_processes_left;
|
||||||
|
int process_rank;
|
||||||
cpumask_t cpus_used;
|
cpumask_t cpus_used;
|
||||||
struct list_head pli_list;
|
struct list_head pli_list;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -2416,6 +2416,7 @@ int main(int argc, char **argv)
|
|||||||
struct get_cpu_set_arg cpu_set_arg;
|
struct get_cpu_set_arg cpu_set_arg;
|
||||||
int mcexec_linux_numa = 0;
|
int mcexec_linux_numa = 0;
|
||||||
int ikc_mapped = 0;
|
int ikc_mapped = 0;
|
||||||
|
int process_rank = -1;
|
||||||
cpu_set_t mcexec_cpu_set;
|
cpu_set_t mcexec_cpu_set;
|
||||||
|
|
||||||
CPU_ZERO(&mcexec_cpu_set);
|
CPU_ZERO(&mcexec_cpu_set);
|
||||||
@ -2424,6 +2425,7 @@ int main(int argc, char **argv)
|
|||||||
cpu_set_arg.cpu_set_size = sizeof(desc->cpu_set);
|
cpu_set_arg.cpu_set_size = sizeof(desc->cpu_set);
|
||||||
cpu_set_arg.nr_processes = nr_processes;
|
cpu_set_arg.nr_processes = nr_processes;
|
||||||
cpu_set_arg.target_core = &target_core;
|
cpu_set_arg.target_core = &target_core;
|
||||||
|
cpu_set_arg.process_rank = &process_rank;
|
||||||
cpu_set_arg.mcexec_linux_numa = &mcexec_linux_numa;
|
cpu_set_arg.mcexec_linux_numa = &mcexec_linux_numa;
|
||||||
cpu_set_arg.mcexec_cpu_set = &mcexec_cpu_set;
|
cpu_set_arg.mcexec_cpu_set = &mcexec_cpu_set;
|
||||||
cpu_set_arg.mcexec_cpu_set_size = sizeof(mcexec_cpu_set);
|
cpu_set_arg.mcexec_cpu_set_size = sizeof(mcexec_cpu_set);
|
||||||
@ -2436,6 +2438,7 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
desc->cpu = target_core;
|
desc->cpu = target_core;
|
||||||
|
desc->process_rank = process_rank;
|
||||||
|
|
||||||
/* Bind to CPU cores where the LWK process' IKC target maps to */
|
/* Bind to CPU cores where the LWK process' IKC target maps to */
|
||||||
if (ikc_mapped && !no_bind_ikc_map) {
|
if (ikc_mapped && !no_bind_ikc_map) {
|
||||||
|
|||||||
@ -482,6 +482,7 @@ static int process_msg_prepare_process(unsigned long rphys)
|
|||||||
proc->mpol_flags = pn->mpol_flags;
|
proc->mpol_flags = pn->mpol_flags;
|
||||||
proc->mpol_threshold = pn->mpol_threshold;
|
proc->mpol_threshold = pn->mpol_threshold;
|
||||||
proc->nr_processes = pn->nr_processes;
|
proc->nr_processes = pn->nr_processes;
|
||||||
|
proc->process_rank = pn->process_rank;
|
||||||
proc->heap_extension = pn->heap_extension;
|
proc->heap_extension = pn->heap_extension;
|
||||||
|
|
||||||
/* Update NUMA binding policy if requested */
|
/* Update NUMA binding policy if requested */
|
||||||
|
|||||||
@ -572,6 +572,7 @@ struct process {
|
|||||||
unsigned long profile_elapsed_ts;
|
unsigned long profile_elapsed_ts;
|
||||||
#endif // PROFILE_ENABLE
|
#endif // PROFILE_ENABLE
|
||||||
int nr_processes; /* For partitioned execution */
|
int nr_processes; /* For partitioned execution */
|
||||||
|
int process_rank; /* Rank in partition */
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -200,6 +200,7 @@ struct program_load_desc {
|
|||||||
long stack_premap;
|
long stack_premap;
|
||||||
unsigned long mpol_bind_mask;
|
unsigned long mpol_bind_mask;
|
||||||
int nr_processes;
|
int nr_processes;
|
||||||
|
int process_rank;
|
||||||
char shell_path[SHELL_PATH_MAX_LEN];
|
char shell_path[SHELL_PATH_MAX_LEN];
|
||||||
__cpu_set_unit cpu_set[PLD_CPU_SET_SIZE];
|
__cpu_set_unit cpu_set[PLD_CPU_SET_SIZE];
|
||||||
int profile;
|
int profile;
|
||||||
|
|||||||
Reference in New Issue
Block a user