Mercurial > hg > graal-jvmci-8
comparison src/os/linux/vm/os_linux.hpp @ 12177:0d59407e7e09
Merge
author | jmasa |
---|---|
date | Thu, 29 Aug 2013 06:53:16 -0700 |
parents | 4c84d351cca9 88c255656030 |
children | 2e6938dd68f2 |
comparison
equal
deleted
inserted
replaced
12116:1624a68007bd | 12177:0d59407e7e09 |
---|---|
233 typedef int (*numa_node_to_cpus_func_t)(int node, unsigned long *buffer, int bufferlen); | 233 typedef int (*numa_node_to_cpus_func_t)(int node, unsigned long *buffer, int bufferlen); |
234 typedef int (*numa_max_node_func_t)(void); | 234 typedef int (*numa_max_node_func_t)(void); |
235 typedef int (*numa_available_func_t)(void); | 235 typedef int (*numa_available_func_t)(void); |
236 typedef int (*numa_tonode_memory_func_t)(void *start, size_t size, int node); | 236 typedef int (*numa_tonode_memory_func_t)(void *start, size_t size, int node); |
237 typedef void (*numa_interleave_memory_func_t)(void *start, size_t size, unsigned long *nodemask); | 237 typedef void (*numa_interleave_memory_func_t)(void *start, size_t size, unsigned long *nodemask); |
238 typedef void (*numa_set_bind_policy_func_t)(int policy); | |
238 | 239 |
239 static sched_getcpu_func_t _sched_getcpu; | 240 static sched_getcpu_func_t _sched_getcpu; |
240 static numa_node_to_cpus_func_t _numa_node_to_cpus; | 241 static numa_node_to_cpus_func_t _numa_node_to_cpus; |
241 static numa_max_node_func_t _numa_max_node; | 242 static numa_max_node_func_t _numa_max_node; |
242 static numa_available_func_t _numa_available; | 243 static numa_available_func_t _numa_available; |
243 static numa_tonode_memory_func_t _numa_tonode_memory; | 244 static numa_tonode_memory_func_t _numa_tonode_memory; |
244 static numa_interleave_memory_func_t _numa_interleave_memory; | 245 static numa_interleave_memory_func_t _numa_interleave_memory; |
246 static numa_set_bind_policy_func_t _numa_set_bind_policy; | |
245 static unsigned long* _numa_all_nodes; | 247 static unsigned long* _numa_all_nodes; |
246 | 248 |
247 static void set_sched_getcpu(sched_getcpu_func_t func) { _sched_getcpu = func; } | 249 static void set_sched_getcpu(sched_getcpu_func_t func) { _sched_getcpu = func; } |
248 static void set_numa_node_to_cpus(numa_node_to_cpus_func_t func) { _numa_node_to_cpus = func; } | 250 static void set_numa_node_to_cpus(numa_node_to_cpus_func_t func) { _numa_node_to_cpus = func; } |
249 static void set_numa_max_node(numa_max_node_func_t func) { _numa_max_node = func; } | 251 static void set_numa_max_node(numa_max_node_func_t func) { _numa_max_node = func; } |
250 static void set_numa_available(numa_available_func_t func) { _numa_available = func; } | 252 static void set_numa_available(numa_available_func_t func) { _numa_available = func; } |
251 static void set_numa_tonode_memory(numa_tonode_memory_func_t func) { _numa_tonode_memory = func; } | 253 static void set_numa_tonode_memory(numa_tonode_memory_func_t func) { _numa_tonode_memory = func; } |
252 static void set_numa_interleave_memory(numa_interleave_memory_func_t func) { _numa_interleave_memory = func; } | 254 static void set_numa_interleave_memory(numa_interleave_memory_func_t func) { _numa_interleave_memory = func; } |
255 static void set_numa_set_bind_policy(numa_set_bind_policy_func_t func) { _numa_set_bind_policy = func; } | |
253 static void set_numa_all_nodes(unsigned long* ptr) { _numa_all_nodes = ptr; } | 256 static void set_numa_all_nodes(unsigned long* ptr) { _numa_all_nodes = ptr; } |
254 static int sched_getcpu_syscall(void); | 257 static int sched_getcpu_syscall(void); |
255 public: | 258 public: |
256 static int sched_getcpu() { return _sched_getcpu != NULL ? _sched_getcpu() : -1; } | 259 static int sched_getcpu() { return _sched_getcpu != NULL ? _sched_getcpu() : -1; } |
257 static int numa_node_to_cpus(int node, unsigned long *buffer, int bufferlen) { | 260 static int numa_node_to_cpus(int node, unsigned long *buffer, int bufferlen) { |
263 return _numa_tonode_memory != NULL ? _numa_tonode_memory(start, size, node) : -1; | 266 return _numa_tonode_memory != NULL ? _numa_tonode_memory(start, size, node) : -1; |
264 } | 267 } |
265 static void numa_interleave_memory(void *start, size_t size) { | 268 static void numa_interleave_memory(void *start, size_t size) { |
266 if (_numa_interleave_memory != NULL && _numa_all_nodes != NULL) { | 269 if (_numa_interleave_memory != NULL && _numa_all_nodes != NULL) { |
267 _numa_interleave_memory(start, size, _numa_all_nodes); | 270 _numa_interleave_memory(start, size, _numa_all_nodes); |
271 } | |
272 } | |
273 static void numa_set_bind_policy(int policy) { | |
274 if (_numa_set_bind_policy != NULL) { | |
275 _numa_set_bind_policy(policy); | |
268 } | 276 } |
269 } | 277 } |
270 static int get_node_by_cpu(int cpu_id); | 278 static int get_node_by_cpu(int cpu_id); |
271 }; | 279 }; |
272 | 280 |