Manual Pages for Linux CentOS command on man get_mempolicy
MyWebUniversity

Manual Pages for Linux CentOS command on man get_mempolicy

GETMEMPOLICY(2) Linux Programmer's Manual GETMEMPOLICY(2)

NAME

getmempolicy - retrieve NUMA memory policy for a process SYNOPSIS

#include int getmempolicy(int *mode, unsigned long *nodemask, unsigned long maxnode, unsigned long addr, unsigned long flags);

Link with -lnuma. DESCRIPTION getmempolicy() retrieves the NUMA policy of the calling process or of a memory address, depending on the setting of flags. A NUMA machine has different memory controllers with different dis‐ tances to specific CPUs. The memory policy defines from which node memory is allocated for the process. If flags is specified as 0, then information about the calling process's default policy (as set by setmempolicy(2)) is returned. The policy returned [mode and nodemask] may be used to restore the process's policy to its state at the time of the call to getmempol‐ icy() using setmempolicy(2). If flags specifies MPOLFMEMSALLOWED (available since Linux 2.6.24), the mode argument is ignored and the set of nodes [memories] that the process is allowed to specify in subsequent calls to mbind(2) or setmempolicy(2) [in the absence of any mode flags] is returned in nodemask. It is not permitted to combine MPOLFMEMSALLOWED with either MPOLFADDR or MPOLFNODE. If flags specifies MPOLFADDR, then information is returned about the policy governing the memory address given in addr. This policy may be different from the process's default policy if mbind(2) or one of the helper functions described in numa(3) has been used to establish a pol‐ icy for the memory range containing addr. If the mode argument is not NULL, then getmempolicy() will store the policy mode and any optional mode flags of the requested NUMA policy in the location pointed to by this argument. If nodemask is not NULL, then the nodemask associated with the policy will be stored in the location pointed to by this argument. maxnode specifies the number of node IDs that can be stored into nodemask—that is, the maximum node ID plus one. The value specified by maxnode is always rounded to a multi‐ ple of sizeof(unsigned long). If flags specifies both MPOLFNODE and MPOLFADDR, getmempolicy() will return the node ID of the node on which the address addr is allo‐ cated into the location pointed to by mode. If no page has yet been allocated for the specified address, getmempolicy() will allocate a page as if the process had performed a read [load] access to that address, and return the ID of the node where that page was allocated. If flags specifies MPOLFNODE, but not MPOLFADDR, and the process's current policy is MPOLINTERLEAVE, then getmempolicy() will return in

the location pointed to by a non-NULL mode argument, the node ID of the next node that will be used for interleaving of internal kernel pages allocated on behalf of the process. These allocations include pages for memory mapped files in process memory ranges mapped using the mmap(2) call with the MAPPRIVATE flag for read accesses, and in memory ranges mapped with the MAPSHARED flag for all accesses. Other flag values are reserved. For an overview of the possible policies see setmempolicy(2). RETURN VALUE

On success, getmempolicy() returns 0; on error, -1 is returned and errno is set to indicate the error. ERRORS EFAULT Part of all of the memory range specified by nodemask and maxn‐ ode points outside your accessible address space. EINVAL The value specified by maxnode is less than the number of node IDs supported by the system. Or flags specified values other than MPOLFNODE or MPOLFADDR; or flags specified MPOLFADDR and addr is NULL, or flags did not specify MPOLFADDR and addr is not NULL. Or, flags specified MPOLFNODE but not MPOLFADDR and the current process policy is not MPOLINTER‐ LEAVE. Or, flags specified MPOLFMEMSALLOWED with either MPOLFADDR or MPOLFNODE. (And there are other EINVAL cases.) VERSIONS The getmempolicy() system call was added to the Linux kernel in ver‐ sion 2.6.7. CONFORMING TO

This system call is Linux-specific. NOTES For information on library support, see numa(7). SEE ALSO getcpu(2), mbind(2), mmap(2), setmempolicy(2), numa(3), numa(7), numactl(8) COLOPHON

This page is part of release 3.53 of the Linux man-pages project. A description of the project, and information about reporting bugs, can

be found at http://www.kernel.org/doc/man-pages/.

Linux 2008-08-15 GETMEMPOLICY(2)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™