get_mempolicy(2) System Calls Manual get_mempolicy(2) get_mempolicy - NUMA LIBRARY NUMA (Non-Uniform Memory Access) policy library (libnuma, -lnuma) #include long get_mempolicy(int *mode, unsigned long nodemask[(.maxnode + ULONG_WIDTH - 1) / ULONG_WIDTH], unsigned long maxnode, void *addr, unsigned long flags); get_mempolicy() NUMA ( flags). NUMA . , . flags 0, , mode nodemask, ( set_mempolicy(2)). get_mempolicy() set_mempolicy(2). flags 0, addr NULL. flags MPOL_F_MEMS_ALLOWED (, Linux 2.6.24), mode ( ), mbind(2) set_mempolicy(2) ( ), nodemask. MPOL_F_MEMS_ALLOWED MPOL_F_ADDR MPOL_F_NODE. flags MPOL_F_ADDR, , addr. , mbind(2) , numa(3), , addr. If the mode argument is not NULL, then get_mempolicy() 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 multiple of sizeof(unsigned long)*8. flags MPOL_F_NODE MPOL_F_ADDR, get_mempolicy() , addr , mode. , get_mempolicy() , () , , . flags MPOL_F_NODE, MPOL_F_ADDR, MPOL_INTERLEAVE, get_mempolicy() , mode ( NULL), , , . , mmap(2) MAP_PRIVATE , , MAP_SHARED, . . set_mempolicy(2). get_mempolicy() 0; -- -1, errno . EFAULT , nodemask maxnode, . EINVAL , maxnode, , . flags , MPOL_F_NODE MPOL_F_ADDR; flags MPOL_F_ADDR addr NULL, flags MPOL_F_ADDR addr NULL. flags MPOL_F_NODE, MPOL_F_ADDR MPOL_INTERLEAVE. flags MPOL_F_MEMS_ALLOWED MPOL_F_ADDR MPOL_F_NODE ( EINVAL). Linux. Linux 2.6.7. numa(7). . getcpu(2), mbind(2), mmap(2), set_mempolicy(2), numa(3), numa(7), numactl(8) Azamat Hackimov , Dmitry Bolkhovskikh , Vladislav , Yuri Kozlov ; GNU 3 , . . , , . Linux man-pages 6.06 31 2023 . get_mempolicy(2)