numaif.h vs numa.h
numaif.h
andnuma.h
are two header files provided bylibnuma
. In other words, you need to installlibnuma
to have these headers somewhere in your include path.numaif.h
is just a wrapper for Linux system calls related to NUMA management and not already wrapped in thelibc
. For these system calls,libnuma
uses the Linux genericsyscall
function allowing to make a system call by providing its name and its parameters.numa.h
is the header exposing the high level functions provided bylibnuma
. The main goal for these functions is to abstract some details about using the Linux kernel NUMA management functions.get_mempolicy
is a Linux system call for NUMA management. As such, it’s also wrapped bylibnuma
and exposed bynumaif.h
. This function, among other things, can be used to get the NUMA node of a single page specified by a memory address.numa_move_pages
is function provided bylibnuma
and strangely exposed bynuma.h
. Indeed, all it does is calling the Linux kernelmove_pages
(man page : It simply uses the move_pages system call). As opposed toget_mempolicy
it allows to get the NUMA node for several pages at once specified through a table.