H.J. Lu
2018-12-05 14:29:28 UTC
To optimize for multi-node NUMA system, I need a very fast way to identity which
node the current process is running on. getcpu:
NAME
getcpu - determine CPU and NUMA node on which the calling thread is
running
SYNOPSIS
#include <linux/getcpu.h>
int getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *tcache);
Note: There is no glibc wrapper for this system call; see NOTES.
DESCRIPTION
The getcpu() system call identifies the processor and node on which the
calling thread or process is currently running and writes them into the
integers pointed to by the cpu and node arguments. The processor is a
unique small integer identifying a CPU. The node is a unique small
identifier identifying a NUMA node. When either cpu or node is NULL
nothing is written to the respective pointer.
returns such info. But syscall () is too slow. I'd like to add a wrapper to
glibc. Any comments?
Thanks.
node the current process is running on. getcpu:
NAME
getcpu - determine CPU and NUMA node on which the calling thread is
running
SYNOPSIS
#include <linux/getcpu.h>
int getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *tcache);
Note: There is no glibc wrapper for this system call; see NOTES.
DESCRIPTION
The getcpu() system call identifies the processor and node on which the
calling thread or process is currently running and writes them into the
integers pointed to by the cpu and node arguments. The processor is a
unique small integer identifying a CPU. The node is a unique small
identifier identifying a NUMA node. When either cpu or node is NULL
nothing is written to the respective pointer.
returns such info. But syscall () is too slow. I'd like to add a wrapper to
glibc. Any comments?
Thanks.
--
H.J.
H.J.