SMP: generic function call facility for CPU sets

This commit is contained in:
Balazs Gerofi
2017-05-05 13:49:43 +09:00
parent ba7edf1981
commit dd2ef89997
4 changed files with 173 additions and 1 deletions

View File

@@ -58,6 +58,26 @@ extern ihk_spinlock_t cpu_status_lock;
#define CPU_FLAG_NEED_RESCHED 0x1U
#define CPU_FLAG_NEED_MIGRATE 0x2U
typedef int (*smp_func_t)(int cpu_index, int nr_cpus, void *arg);
int smp_call_func(cpu_set_t *__cpu_set, smp_func_t __func, void *__arg);
struct smp_func_call_data {
/* XXX: Sync MCS lock to avoid contention on counter */
// mcs_lock_node_t lock;
int nr_cpus;
ihk_atomic_t cpus_left;
smp_func_t func;
void *arg;
};
struct smp_func_call_request {
struct smp_func_call_data *sfcd;
int cpu_index;
int ret;
struct list_head list;
};
struct cpu_local_var {
/* malloc */
struct list_head free_list;
@@ -93,6 +113,9 @@ struct cpu_local_var {
int timer_enabled;
int kmalloc_initialized;
struct ihk_os_monitor *monitor;
ihk_spinlock_t smp_func_req_lock;
struct list_head smp_func_req_list;
} __attribute__((aligned(64)));