get_mempolicy
NAME
get_mempolicy - Retrieve NUMA memory policy for a process
SYNOPSIS
#include <numaif.h>
I int get_mempolicy(int * policy , unsigned long * nodemask , I unsigned long maxnode , unsigned long addr , I unsigned long flags );
DESCRIPTION
R get_mempolicy ()
retrieves the NUMA policy of the calling process or of a memory address,
depending on the setting of
R flags .
A NUMA machine has different
memory controllers with different distances to specific CPUs.
The memory policy defines in which node memory is allocated for
the process.
If
R flags
is specified as 0,
then information about the calling process's default policy
(as set by
set_mempolicy(2))
is returned.
If
flags
specifies
R MPOL_F_ADDR ,
then information is returned about the policy governing the memory
address given in
R addr .
This policy may be different from the process's default policy if
set_mempolicy(2)
has been used to establish a policy for the page containing
R addr .
If
policy
is not NULL, then it is used to return the policy.
If
R nodemask
is not NULL, then it is used to return the nodemask associated
with the policy.
maxnode
is the maximum bit number plus one that can be stored into
R nodemask .
The bit number is always rounded to a multiple of
R unsigned long .
For an overview of the possible policies see
set_mempolicy(2).
RETURN VALUE
On success,
R get_mempolicy ()
returns 0;
on error, -1 is returned and
errno
is set to indicate the error.
CONFORMING TO
This system call is Linux specific.
NOTES
This manual page is incomplete:
it does not document the details the
R MPOL_F_NODE
flag,
which modifies the operation of
R get_mempolicy ().
This is deliberate: this flag is not intended for application use,
and its operation may change or it may be removed altogether in
future kernel versions.
Do not use it.
