目录

get_mempolicy(2)

set_mempolicy(2)

mbind(2)

numa(3)


get_mempolicy(2)


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

NAME

       get_mempolicy - retrieve NUMA memory policy for a thread

SYNOPSIS

       #include <numaif.h>long get_mempolicy(int *mode, unsigned long *nodemask,unsigned long maxnode, void *addr,unsigned long flags);
       Link with -lnuma.Note: There is no glibc wrapper for this system call; see NOTES.

DESCRIPTION

       get_mempolicy() retrieves the NUMA policy of the calling threador of a memory address, depending on the setting of flags.A NUMA machine has different memory controllers with differentdistances to specific CPUs.  The memory policy defines from whichnode memory is allocated for the thread.If flags is specified as 0, then information about the callingthread's default policy (as set by set_mempolicy(2)) is returned,in the buffers pointed to by mode and nodemask.  The valuereturned in these arguments may be used to restore the thread'spolicy to its state at the time of the call to get_mempolicy()using set_mempolicy(2).  When flags is 0, addr must be specifiedas NULL.If flags specifies MPOL_F_MEMS_ALLOWED (available since Linux2.6.24), the mode argument is ignored and the set of nodes(memories) that the thread is allowed to specify in subsequentcalls to mbind(2) or set_mempolicy(2) (in the absence of any modeflags) is returned in nodemask.  It is not permitted to combineMPOL_F_MEMS_ALLOWED with either MPOL_F_ADDR or MPOL_F_NODE.If flags specifies MPOL_F_ADDR, then information is returnedabout the policy governing the memory address given in addr.This policy may be different from the thread's default policy ifmbind(2) or one of the helper functions described in numa(3) hasbeen used to establish a policy for the memory range containingaddr.If the mode argument is not NULL, then get_mempolicy() will storethe policy mode and any optional mode flags of the requested NUMApolicy in the location pointed to by this argument.  If nodemaskis not NULL, then the nodemask associated with the policy will bestored in the location pointed to by this argument.  maxnodespecifies the number of node IDs that can be stored intonodemask—that is, the maximum node ID plus one.  The valuespecified by maxnode is always rounded to a multiple ofsizeof(unsigned long)*8.If flags specifies both MPOL_F_NODE and MPOL_F_ADDR,get_mempolicy() will return the node ID of the node on which theaddress addr is allocated into the location pointed to by mode.If no page has yet been allocated for the specified address,get_mempolicy() will allocate a page as if the thread hadperformed a read (load) access to that address, and return the IDof the node where that page was allocated.If flags specifies MPOL_F_NODE, but not MPOL_F_ADDR, and thethread's current policy is MPOL_INTERLEAVE, then get_mempolicy()will return in the location pointed to by a non-NULL modeargument, the node ID of the next node that will be used forinterleaving of internal kernel pages allocated on behalf of thethread.  These allocations include pages for memory-mapped filesin process memory ranges mapped using the mmap(2) call with theMAP_PRIVATE flag for read accesses, and in memory ranges mappedwith the MAP_SHARED flag for all accesses.Other flag values are reserved.For an overview of the possible policies see set_mempolicy(2).

RETURN VALUE

       On success, get_mempolicy() returns 0; on error, -1 is returnedand errno is set to indicate the error.

ERRORS

       EFAULT Part of all of the memory range specified by nodemask andmaxnode points outside your accessible address space.EINVAL The value specified by maxnode is less than the number ofnode IDs supported by the system.  Or flags specifiedvalues other than MPOL_F_NODE or MPOL_F_ADDR; or flagsspecified MPOL_F_ADDR and addr is NULL, or flags did notspecify MPOL_F_ADDR and addr is not NULL.  Or, flagsspecified MPOL_F_NODE but not MPOL_F_ADDR and the currentthread policy is not MPOL_INTERLEAVE.  Or, flags specifiedMPOL_F_MEMS_ALLOWED with either MPOL_F_ADDR orMPOL_F_NODE.  (And there are other EINVAL cases.)

VERSIONS

       The get_mempolicy() system call was added to the Linux kernel inversion 2.6.7.

CONFORMING TO

       This system call is Linux-specific.

NOTES

       Glibc does not provide a wrapper for this system call.  Forinformation on library support, see numa(7).

SEE ALSO

       getcpu(2), mbind(2), mmap(2), set_mempolicy(2), numa(3), numa(7),numactl(8)

COLOPHON

       This page is part of release 5.11 of the Linux man-pages project.A description of the project, information about reporting bugs,and the latest version of this page, can be found athttps://www.kernel.org/doc/man-pages/.Linux                          2021-03-22               GET_MEMPOLICY(2)

Pages that refer to this page: mbind(2),  migrate_pages(2),  move_pages(2),  set_mempolicy(2),  syscalls(2),  numa(3),  cpuset(7),  numa(7),  migratepages(8),  numactl(8)

DEMO

int
rte_vhost_get_numa_node(int vid)
{
#ifdef RTE_LIBRTE_VHOST_NUMAstruct virtio_net *dev = get_device(vid);int numa_node;int ret;if (dev == NULL || numa_available() != 0)return -1;ret = get_mempolicy(&numa_node, NULL, 0, dev,MPOL_F_NODE | MPOL_F_ADDR);if (ret < 0) {VHOST_LOG_CONFIG(ERR,"(%d) failed to query numa node: %s\n",vid, rte_strerror(errno));return -1;}return numa_node;
#elseRTE_SET_USED(vid);return -1;
#endif
}

set_mempolicy(2)


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

NAME

       set_mempolicy - set default NUMA memory policy for a thread andits children

SYNOPSIS

       #include <numaif.h>long set_mempolicy(int mode, const unsigned long *nodemask,unsigned long maxnode);
       Link with -lnuma.

DESCRIPTION

       set_mempolicy() sets the NUMA memory policy of the callingthread, which consists of a policy mode and zero or more nodes,to the values specified by the mode, nodemask, and maxnodearguments.A NUMA machine has different memory controllers with differentdistances to specific CPUs.  The memory policy defines from whichnode memory is allocated for the thread.This system call defines the default policy for the thread.  Thethread policy governs allocation of pages in the process'saddress space outside of memory ranges controlled by a morespecific policy set by mbind(2).  The thread default policy alsocontrols allocation of any pages for memory-mapped files mappedusing the mmap(2) call with the MAP_PRIVATE flag and that areonly read (loaded) from by the thread and of memory-mapped filesmapped using the mmap(2) call with the MAP_SHARED flag,regardless of the access type.  The policy is applied only when anew page is allocated for the thread.  For anonymous memory thisis when the page is first touched by the thread.The mode argument must specify one of MPOL_DEFAULT, MPOL_BIND,MPOL_INTERLEAVE, MPOL_PREFERRED, or MPOL_LOCAL (which aredescribed in detail below).  All modes except MPOL_DEFAULTrequire the caller to specify the node or nodes to which the modeapplies, via the nodemask argument.The mode argument may also include an optional mode flag.  Thesupported mode flags are:MPOL_F_STATIC_NODES (since Linux 2.6.26)A nonempty nodemask specifies physical node IDs.  Linuxwill not remap the nodemask when the process moves to adifferent cpuset context, nor when the set of nodesallowed by the process's current cpuset context changes.MPOL_F_RELATIVE_NODES (since Linux 2.6.26)A nonempty nodemask specifies node IDs that are relativeto the set of node IDs allowed by the process's currentcpuset.nodemask points to a bit mask of node IDs that contains up tomaxnode bits.  The bit mask size is rounded to the next multipleof sizeof(unsigned long), but the kernel will use bits only up tomaxnode.  A NULL value of nodemask or a maxnode value of zerospecifies the empty set of nodes.  If the value of maxnode iszero, the nodemask argument is ignored.Where a nodemask is required, it must contain at least one nodethat is on-line, allowed by the process's current cpuset context,(unless the MPOL_F_STATIC_NODES mode flag is specified), andcontains memory.  If the MPOL_F_STATIC_NODES is set in mode and arequired nodemask contains no nodes that are allowed by theprocess's current cpuset context, the memory policy reverts tolocal allocation.  This effectively overrides the specifiedpolicy until the process's cpuset context includes one or more ofthe nodes specified by nodemask.The mode argument must include one of the following values:MPOL_DEFAULTThis mode specifies that any nondefault thread memorypolicy be removed, so that the memory policy "falls back"to the system default policy.  The system default policyis "local allocation"—that is, allocate memory on the nodeof the CPU that triggered the allocation.  nodemask mustbe specified as NULL.  If the "local node" contains nofree memory, the system will attempt to allocate memoryfrom a "near by" node.MPOL_BINDThis mode defines a strict policy that restricts memoryallocation to the nodes specified in nodemask.  Ifnodemask specifies more than one node, page allocationswill come from the node with the lowest numeric node IDfirst, until that node contains no free memory.Allocations will then come from the node with the nexthighest node ID specified in nodemask and so forth, untilnone of the specified nodes contain free memory.  Pageswill not be allocated from any node not specified in thenodemask.MPOL_INTERLEAVEThis mode interleaves page allocations across the nodesspecified in nodemask in numeric node ID order.  Thisoptimizes for bandwidth instead of latency by spreadingout pages and memory accesses to those pages acrossmultiple nodes.  However, accesses to a single page willstill be limited to the memory bandwidth of a single node.MPOL_PREFERREDThis mode sets the preferred node for allocation.  Thekernel will try to allocate pages from this node first andfall back to "near by" nodes if the preferred node is lowon free memory.  If nodemask specifies more than one nodeID, the first node in the mask will be selected as thepreferred node.  If the nodemask and maxnode argumentsspecify the empty set, then the policy specifies "localallocation" (like the system default policy discussedabove).MPOL_LOCAL (since Linux 3.8)This mode specifies "local allocation"; the memory isallocated on the node of the CPU that triggered theallocation (the "local node").  The nodemask and maxnodearguments must specify the empty set.  If the "local node"is low on free memory, the kernel will try to allocatememory from other nodes.  The kernel will allocate memoryfrom the "local node" whenever memory for this node isavailable.  If the "local node" is not allowed by theprocess's current cpuset context, the kernel will try toallocate memory from other nodes.  The kernel willallocate memory from the "local node" whenever it becomesallowed by the process's current cpuset context.The thread memory policy is preserved across an execve(2), and isinherited by child threads created using fork(2) or clone(2).

RETURN VALUE

       On success, set_mempolicy() returns 0; on error, -1 is returnedand errno is set to indicate the error.

ERRORS

       EFAULT Part of all of the memory range specified by nodemask andmaxnode points outside your accessible address space.EINVAL mode is invalid.  Or, mode is MPOL_DEFAULT and nodemask isnonempty, or mode is MPOL_BIND or MPOL_INTERLEAVE andnodemask is empty.  Or, maxnode specifies more than a pageworth of bits.  Or, nodemask specifies one or more nodeIDs that are greater than the maximum supported node ID.Or, none of the node IDs specified by nodemask are on-lineand allowed by the process's current cpuset context, ornone of the specified nodes contain memory.  Or, the modeargument specified both MPOL_F_STATIC_NODES andMPOL_F_RELATIVE_NODES.ENOMEM Insufficient kernel memory was available.

VERSIONS

       The set_mempolicy() system call was added to the Linux kernel inversion 2.6.7.

CONFORMING TO

       This system call is Linux-specific.

NOTES

       Memory policy is not remembered if the page is swapped out.  Whensuch a page is paged back in, it will use the policy of thethread or memory range that is in effect at the time the page isallocated.For information on library support, see numa(7).

SEE ALSO

       get_mempolicy(2), getcpu(2), mbind(2), mmap(2), numa(3),cpuset(7), numa(7), numactl(8)

COLOPHON

       This page is part of release 5.11 of the Linux man-pages project.A description of the project, information about reporting bugs,and the latest version of this page, can be found athttps://www.kernel.org/doc/man-pages/.Linux                          2020-12-21               SET_MEMPOLICY(2)

Pages that refer to this page: getcpu(2),  get_mempolicy(2),  mbind(2),  migrate_pages(2),  move_pages(2),  syscalls(2),  numa(3),  systemd.exec(5),  tmpfs(5),  cpuset(7),  numa(7),  migratepages(8),  numactl(8)

mbind(2)


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

NAME

       mbind - set memory policy for a memory range

SYNOPSIS

      #include <numaif.h>long mbind(void *addr, unsigned long len, int mode,const unsigned long *nodemask, unsigned long maxnode,unsigned int flags);
        Link with -lnuma.Note: There is no glibc wrapper for this system call; see NOTES.

DESCRIPTION

       mbind() sets the NUMA memory policy, which consists of a policymode and zero or more nodes, for the memory range starting withaddr and continuing for len bytes.  The memory policy definesfrom which node memory is allocated.If the memory range specified by the addr and len argumentsincludes an "anonymous" region of memory—that is a region ofmemory created using the mmap(2) system call with theMAP_ANONYMOUS—or a memory-mapped file, mapped using the mmap(2)system call with the MAP_PRIVATE flag, pages will be allocatedonly according to the specified policy when the applicationwrites (stores) to the page.  For anonymous regions, an initialread access will use a shared page in the kernel containing allzeros.  For a file mapped with MAP_PRIVATE, an initial readaccess will allocate pages according to the memory policy of thethread that causes the page to be allocated.  This may not be thethread that called mbind().The specified policy will be ignored for any MAP_SHARED mappingsin the specified memory range.  Rather the pages will beallocated according to the memory policy of the thread thatcaused the page to be allocated.  Again, this may not be thethread that called mbind().If the specified memory range includes a shared memory regioncreated using the shmget(2) system call and attached using theshmat(2) system call, pages allocated for the anonymous or sharedmemory region will be allocated according to the policyspecified, regardless of which process attached to the sharedmemory segment causes the allocation.  If, however, the sharedmemory region was created with the SHM_HUGETLB flag, the hugepages will be allocated according to the policy specified only ifthe page allocation is caused by the process that calls mbind()for that region.By default, mbind() has an effect only for new allocations; ifthe pages inside the range have been already touched beforesetting the policy, then the policy has no effect.  This defaultbehavior may be overridden by the MPOL_MF_MOVE andMPOL_MF_MOVE_ALL flags described below.The mode argument must specify one of MPOL_DEFAULT, MPOL_BIND,MPOL_INTERLEAVE, MPOL_PREFERRED, or MPOL_LOCAL (which aredescribed in detail below).  All policy modes except MPOL_DEFAULTrequire the caller to specify the node or nodes to which the modeapplies, via the nodemask argument.The mode argument may also include an optional mode flag.  Thesupported mode flags are:MPOL_F_STATIC_NODES (since Linux-2.6.26)A nonempty nodemask specifies physical node IDs.  Linuxdoes not remap the nodemask when the thread moves to adifferent cpuset context, nor when the set of nodesallowed by the thread's current cpuset context changes.MPOL_F_RELATIVE_NODES (since Linux-2.6.26)A nonempty nodemask specifies node IDs that are relativeto the set of node IDs allowed by the thread's currentcpuset.nodemask points to a bit mask of nodes containing up to maxnodebits.  The bit mask size is rounded to the next multiple ofsizeof(unsigned long), but the kernel will use bits only up tomaxnode.  A NULL value of nodemask or a maxnode value of zerospecifies the empty set of nodes.  If the value of maxnode iszero, the nodemask argument is ignored.  Where a nodemask isrequired, it must contain at least one node that is on-line,allowed by the thread's current cpuset context (unless theMPOL_F_STATIC_NODES mode flag is specified), and contains memory.The mode argument must include one of the following values:MPOL_DEFAULTThis mode requests that any nondefault policy be removed,restoring default behavior.  When applied to a range ofmemory via mbind(), this means to use the thread memorypolicy, which may have been set with set_mempolicy(2).  Ifthe mode of the thread memory policy is also MPOL_DEFAULT,the system-wide default policy will be used.  The system-wide default policy allocates pages on the node of the CPUthat triggers the allocation.  For MPOL_DEFAULT, thenodemask and maxnode arguments must be specify the emptyset of nodes.MPOL_BINDThis mode specifies a strict policy that restricts memoryallocation to the nodes specified in nodemask.  Ifnodemask specifies more than one node, page allocationswill come from the node with sufficient free memory thatis closest to the node where the allocation takes place.Pages will not be allocated from any node not specified inthe IR nodemask .  (Before Linux 2.6.26, page allocationscame from the node with the lowest numeric node ID first,until that node contained no free memory.  Allocationsthen came from the node with the next highest node IDspecified in nodemask and so forth, until none of thespecified nodes contained free memory.)MPOL_INTERLEAVE(交错)This mode specifies that page allocations be interleavedacross the set of nodes specified in nodemask.  Thisoptimizes for bandwidth instead of latency by spreadingout pages and memory accesses to those pages acrossmultiple nodes.  To be effective the memory area should befairly large, at least 1 MB or bigger with a fairlyuniform access pattern.  Accesses to a single page of thearea will still be limited to the memory bandwidth of asingle node.MPOL_PREFERRED(首选的;优先;更喜欢)This mode sets the preferred node for allocation.  Thekernel will try to allocate pages from this node first andfall back to other nodes if the preferred nodes is low onfree memory.  If nodemask specifies more than one node ID,the first node in the mask will be selected as thepreferred node.  If the nodemask and maxnode argumentsspecify the empty set, then the memory is allocated on thenode of the CPU that triggered the allocation.MPOL_LOCAL (since Linux 3.8)This mode specifies "local allocation"; the memory isallocated on the node of the CPU that triggered theallocation (the "local node").  The nodemask and maxnodearguments must specify the empty set.  If the "local node"is low on free memory, the kernel will try to allocatememory from other nodes.  The kernel will allocate memoryfrom the "local node" whenever memory for this node isavailable.  If the "local node" is not allowed by thethread's current cpuset context, the kernel will try toallocate memory from other nodes.  The kernel willallocate memory from the "local node" whenever it becomesallowed by the thread's current cpuset context.  Bycontrast, MPOL_DEFAULT reverts to the memory policy of thethread (which may be set via set_mempolicy(2)); thatpolicy may be something other than "local allocation".If MPOL_MF_STRICT is passed in flags and mode is notMPOL_DEFAULT, then the call fails with the error EIO if theexisting pages in the memory range don't follow the policy.If MPOL_MF_MOVE is specified in flags, then the kernel willattempt to move all the existing pages in the memory range sothat they follow the policy.  Pages that are shared with otherprocesses will not be moved.  If MPOL_MF_STRICT is alsospecified, then the call fails with the error EIO if some pagescould not be moved.If MPOL_MF_MOVE_ALL is passed in flags, then the kernel willattempt to move all existing pages in the memory range regardlessof whether other processes use the pages.  The calling threadmust be privileged (CAP_SYS_NICE) to use this flag.  IfMPOL_MF_STRICT is also specified, then the call fails with theerror EIO if some pages could not be moved.

RETURN VALUE

       On success, mbind() returns 0; on error, -1 is returned and errnois set to indicate the error.

ERRORS

       EFAULT Part or all of the memory range specified by nodemask andmaxnode points outside your accessible address space.  Or,there was an unmapped hole in the specified memory rangespecified by addr and len.EINVAL An invalid value was specified for flags or mode; or addr+ len was less than addr; or addr is not a multiple of thesystem page size.  Or, mode is MPOL_DEFAULT and nodemaskspecified a nonempty set; or mode is MPOL_BIND orMPOL_INTERLEAVE and nodemask is empty.  Or, maxnodeexceeds a kernel-imposed limit.  Or, nodemask specifiesone or more node IDs that are greater than the maximumsupported node ID.  Or, none of the node IDs specified bynodemask are on-line and allowed by the thread's currentcpuset context, or none of the specified nodes containmemory.  Or, the mode argument specified bothMPOL_F_STATIC_NODES and MPOL_F_RELATIVE_NODES.EIO    MPOL_MF_STRICT was specified and an existing page wasalready on a node that does not follow the policy; orMPOL_MF_MOVE or MPOL_MF_MOVE_ALL was specified and thekernel was unable to move all existing pages in the range.ENOMEM Insufficient kernel memory was available.EPERM  The flags argument included the MPOL_MF_MOVE_ALL flag andthe caller does not have the CAP_SYS_NICE privilege.

VERSIONS

       The mbind() system call was added to the Linux kernel in version2.6.7.

CONFORMING TO

       This system call is Linux-specific.

NOTES

       Glibc does not provide a wrapper for this system call.  Forinformation on library support, see numa(7).NUMA policy is not supported on a memory-mapped file range thatwas mapped with the MAP_SHARED flag.The MPOL_DEFAULT mode can have different effects for mbind() andset_mempolicy(2).  When MPOL_DEFAULT is specified forset_mempolicy(2), the thread's memory policy reverts to thesystem default policy or local allocation.  When MPOL_DEFAULT isspecified for a range of memory using mbind(), any pagessubsequently allocated for that range will use the thread'smemory policy, as set by set_mempolicy(2).  This effectivelyremoves the explicit policy from the specified range, "fallingback" to a possibly nondefault policy.  To select explicit "localallocation" for a memory range, specify a mode of MPOL_LOCAL orMPOL_PREFERRED with an empty set of nodes.  This method will workfor set_mempolicy(2), as well.Support for huge page policy was added with 2.6.16.  Forinterleave policy to be effective on huge page mappings thepolicied memory needs to be tens of megabytes or larger.Before Linux 5.7.  MPOL_MF_STRICT was ignored on huge pagemappings.MPOL_MF_MOVE and MPOL_MF_MOVE_ALL are available only on Linux2.6.16 and later.

SEE ALSO

       get_mempolicy(2), getcpu(2), mmap(2), set_mempolicy(2), shmat(2),shmget(2), numa(3), cpuset(7), numa(7), numactl(8)

COLOPHON

       This page is part of release 5.11 of the Linux man-pages project.A description of the project, information about reporting bugs,and the latest version of this page, can be found athttps://www.kernel.org/doc/man-pages/.Linux                          2021-03-22                       MBIND(2)

Pages that refer to this page: getcpu(2),  get_mempolicy(2),  migrate_pages(2),  move_pages(2),  set_mempolicy(2),  swapon(2),  syscalls(2),  numa(3),  proc(5),  capabilities(7),  cpuset(7),  numa(7),  migratepages(8),  numactl(8)

numa(3)


NUMA(3)                 Linux Programmer's Manual                NUMA(3)

NAME

       numa - NUMA policy library

SYNOPSIS

       #include <numa.h>cc ... -lnumaint numa_available(void);int numa_max_possible_node(void);int numa_num_possible_nodes();int numa_max_node(void);int numa_num_configured_nodes();struct bitmask *numa_get_mems_allowed(void);int numa_num_configured_cpus(void);struct bitmask *numa_all_nodes_ptr;struct bitmask *numa_no_nodes_ptr;struct bitmask *numa_all_cpus_ptr;int numa_num_task_cpus();int numa_num_task_nodes();int numa_parse_bitmap(char *line , struct bitmask *mask);struct bitmask *numa_parse_nodestring(const char *string);struct bitmask *numa_parse_nodestring_all(const char *string);struct bitmask *numa_parse_cpustring(const char *string);struct bitmask *numa_parse_cpustring_all(const char *string);long numa_node_size(int node, long *freep);long long numa_node_size64(int node, long long *freep);int numa_preferred(void);void numa_set_preferred(int node);int numa_get_interleave_node(void);struct bitmask *numa_get_interleave_mask(void);void numa_set_interleave_mask(struct bitmask *nodemask);void numa_interleave_memory(void *start, size_t size, structbitmask *nodemask);void numa_bind(struct bitmask *nodemask);void numa_set_localalloc(void);void numa_set_membind(struct bitmask *nodemask);void numa_set_membind_balancing(struct bitmask *nodemask);struct bitmask *numa_get_membind(void);void *numa_alloc_onnode(size_t size, int node);void *numa_alloc_local(size_t size);void *numa_alloc_interleaved(size_t size);void *numa_alloc_interleaved_subset(size_t size,  struct bitmask*nodemask); void *numa_alloc(size_t size);void *numa_realloc(void *old_addr, size_t old_size, size_tnew_size);void numa_free(void *start, size_t size);int numa_run_on_node(int node);int numa_run_on_node_mask(struct bitmask *nodemask);int numa_run_on_node_mask_all(struct bitmask *nodemask);struct bitmask *numa_get_run_node_mask(void);void numa_tonode_memory(void *start, size_t size, int node);void numa_tonodemask_memory(void *start, size_t size, structbitmask *nodemask);void numa_setlocal_memory(void *start, size_t size);void numa_police_memory(void *start, size_t size);void numa_set_bind_policy(int strict);void numa_set_strict(int strict);int numa_distance(int node1, int node2);int numa_sched_getaffinity(pid_t pid, struct bitmask *mask);int numa_sched_setaffinity(pid_t pid, struct bitmask *mask);int numa_node_to_cpus(int node, struct bitmask *mask);void numa_node_to_cpu_update();int numa_node_of_cpu(int cpu);struct bitmask *numa_allocate_cpumask();void numa_free_cpumask();struct bitmask *numa_allocate_nodemask();void numa_free_nodemask();struct bitmask *numa_bitmask_alloc(unsigned int n);struct bitmask *numa_bitmask_clearall(struct bitmask *bmp);struct bitmask *numa_bitmask_clearbit(struct bitmask *bmp,unsigned int n);int numa_bitmask_equal(const struct bitmask *bmp1, const structbitmask *bmp2);void numa_bitmask_free(struct bitmask *bmp);int numa_bitmask_isbitset(const struct bitmask *bmp, unsigned intn);unsigned int numa_bitmask_nbytes(struct bitmask *bmp);struct bitmask *numa_bitmask_setall(struct bitmask *bmp);struct bitmask *numa_bitmask_setbit(struct bitmask *bmp, unsignedint n);void copy_bitmask_to_nodemask(struct bitmask *bmp, nodemask_t*nodemask)void copy_nodemask_to_bitmask(nodemask_t *nodemask, structbitmask *bmp)void copy_bitmask_to_bitmask(struct bitmask *bmpfrom, structbitmask *bmpto)unsigned int numa_bitmask_weight(const struct bitmask *bmp )int numa_move_pages(int pid, unsigned long count, void **pages,const int *nodes, int *status, int flags);int numa_migrate_pages(int pid, struct bitmask *fromnodes, structbitmask *tonodes);void numa_error(char *where);extern int numa_exit_on_error;extern int numa_exit_on_warn;void numa_warn(int number, char *where, ...);

DESCRIPTION

       The libnuma library offers a simple programming interface to theNUMA (Non Uniform Memory Access) policy supported by the Linuxkernel. On a NUMA architecture some memory areas have differentlatency or bandwidth than others.Available policies are page interleaving (i.e., allocate in around-robin fashion from all, or a subset, of the nodes on thesystem), preferred node allocation (i.e., preferably allocate ona particular node), local allocation (i.e., allocate on the nodeon which the task is currently executing), or allocation only onspecific nodes (i.e., allocate on some subset of the availablenodes).  It is also possible to bind tasks to specific nodes.Numa memory allocation policy may be specified as a per-taskattribute, that is inherited by children tasks and processes, oras an attribute of a range of process virtual address space.Numa memory policies specified for a range of virtual addressspace are shared by all tasks in the process.  Furthermore,memory policies specified for a range of a shared memory attachedusing shmat(2) or mmap(2) from shmfs/hugetlbfs are shared by allprocesses that attach to that region.  Memory policies for shareddisk backed file mappings are currently ignored.The default memory allocation policy for tasks and all memoryrange is local allocation.  This assumes that no ancestor hasinstalled a non-default policy.For setting a specific policy globally for all memory allocationsin a process and its children it is easiest to start it with thenumactl(8) utility. For more finegrained policy inside anapplication this library can be used.All numa memory allocation policy only takes effect when a pageis actually faulted into the address space of a process byaccessing it. The numa_alloc_* functions take care of thisautomatically.A node is defined as an area where all memory has the same speedas seen from a particular CPU.  A node can contain multiple CPUs.Caches are ignored for this definition.Most functions in this library are only concerned about numanodes and their memory.  The exceptions to this are:numa_node_to_cpus(), numa_node_to_cpu_update(),numa_node_of_cpu(), numa_bind(), numa_run_on_node(),numa_run_on_node_mask(), numa_run_on_node_mask_all(), andnuma_get_run_node_mask().  These functions deal with the CPUsassociated with numa nodes.  See the descriptions below for moreinformation.Some of these functions accept or return a pointer to structbitmask.  A struct bitmask controls a bit map of arbitrary lengthcontaining a bit representation of nodes.  The predefinedvariable numa_all_nodes_ptr points to a bit mask that has allavailable nodes set; numa_no_nodes_ptr points to the empty set.Before any other calls in this library can be usednuma_available() must be called. If it returns -1, all otherfunctions in this library are undefined.numa_max_possible_node() returns the number of the highestpossible node in a system.  In other words, the size of a kerneltype nodemask_t (in bits) minus 1.  This number can be gotten bycalling numa_num_possible_nodes() and subtracting 1.numa_num_possible_nodes() returns the size of kernel's node mask(kernel type nodemask_t).  In other words, large enough torepresent the maximum number of nodes that the kernel can handle.This will match the kernel's MAX_NUMNODES value.  This count isderived from /proc/self/status, field Mems_allowed.numa_max_node() returns the highest node number available on thecurrent system.  (See the node numbers in/sys/devices/system/node/ ).  Also seenuma_num_configured_nodes().numa_num_configured_nodes() returns the number of memory nodes inthe system. This count includes any nodes that are currentlydisabled. This count is derived from the node numbers in/sys/devices/system/node. (Depends on the kernel being configuredwith /sys (CONFIG_SYSFS)).numa_get_mems_allowed() returns the mask of nodes from which theprocess is allowed to allocate memory in it's current cpusetcontext.  Any nodes that are not included in the returned bitmaskwill be ignored in any of the following libnuma memory policycalls.numa_num_configured_cpus() returns the number of cpus in thesystem.  This count includes any cpus that are currentlydisabled. This count is derived from the cpu numbers in/sys/devices/system/cpu. If the kernel is configured without /sys(CONFIG_SYSFS=n) then it falls back to using the number of onlinecpus.numa_all_nodes_ptr points to a bitmask that is allocated by thelibrary with bits representing all nodes on which the callingtask may allocate memory.  This set may be up to all nodes on thesystem, or up to the nodes in the current cpuset.  The bitmask isallocated by a call to numa_allocate_nodemask() using sizenuma_max_possible_node().  The set of nodes to record is derivedfrom /proc/self/status, field "Mems_allowed".  The user shouldnot alter this bitmask.numa_no_nodes_ptr points to a bitmask that is allocated by thelibrary and left all zeroes.  The bitmask is allocated by a callto numa_allocate_nodemask() using size numa_max_possible_node().The user should not alter this bitmask.numa_all_cpus_ptr points to a bitmask that is allocated by thelibrary with bits representing all cpus on which the calling taskmay execute.  This set may be up to all cpus on the system, or upto the cpus in the current cpuset.  The bitmask is allocated by acall to numa_allocate_cpumask() using sizenuma_num_possible_cpus().  The set of cpus to record is derivedfrom /proc/self/status, field "Cpus_allowed".  The user shouldnot alter this bitmask.numa_num_task_cpus() returns the number of cpus that the callingtask is allowed to use.  This count is derived from the map/proc/self/status, field "Cpus_allowed". Also see the bitmasknuma_all_cpus_ptr.numa_num_task_nodes() returns the number of nodes on which thecalling task is allowed to allocate memory.  This count isderived from the map /proc/self/status, field "Mems_allowed".Also see the bitmask numa_all_nodes_ptr.numa_parse_bitmap() parses line , which is a character stringsuch as found in /sys/devices/system/node/nodeN/cpumap into abitmask structure.  The string contains the hexadecimalrepresentation of a bit map.  The bitmask may be allocated withnuma_allocate_cpumask().  Returns  0 on success.  Returns -1 onfailure.  This function is probably of little use to a userapplication, but it is used by libnuma internally.numa_parse_nodestring() parses a character string list of nodesinto a bit mask.  The bit mask is allocated bynuma_allocate_nodemask().  The string is a comma-separated listof node numbers or node ranges.  A leading ! can be used toindicate "not" this list (in other words, all nodes except thislist), and a leading + can be used to indicate that the nodenumbers in the list are relative to the task's cpuset.  Thestring can be "all" to specify all ( numa_num_task_nodes() )nodes.  Node numbers are limited by the number in the system.See numa_max_node() and numa_num_configured_nodes().Examples:  1-5,7,10   !4-5   +0-3If the string is of 0 length, bitmask numa_no_nodes_ptr isreturned.  Returns 0 if the string is invalid.numa_parse_nodestring_all() is similar to numa_parse_nodestring ,but can parse all possible nodes, not only current nodeset.numa_parse_cpustring() parses a character string list of cpusinto a bit mask.  The bit mask is allocated bynuma_allocate_cpumask().  The string is a comma-separated list ofcpu numbers or cpu ranges.  A leading ! can be used to indicate"not" this list (in other words, all cpus except this list), anda leading + can be used to indicate that the cpu numbers in thelist are relative to the task's cpuset.  The string can be "all"to specify all ( numa_num_task_cpus() ) cpus.  Cpu numbers arelimited by the number in the system.  See numa_num_task_cpus()and numa_num_configured_cpus().Examples:  1-5,7,10   !4-5   +0-3Returns 0 if the string is invalid.numa_parse_cpustring_all() is similar to numa_parse_cpustring ,but can parse all possible cpus, not only current cpuset.numa_node_size() returns the memory size of a node. If theargument freep is not NULL, it used to return the amount of freememory on the node.  On error it returns -1.numa_node_size64() works the same as numa_node_size() except thatit returns values as long long instead of long.  This is usefulon 32-bit architectures with large nodes.numa_preferred() returns the preferred node of the current task.This is the node on which the kernel preferably allocates memory,unless some other policy overrides this.numa_set_preferred() sets the preferred node for the current taskto node.  The system will attempt to allocate memory from thepreferred node, but will fall back to other nodes if no memory isavailable on the the preferred node.  Passing a node of -1argument specifies local allocation and is equivalent to callingnuma_set_localalloc().numa_get_interleave_mask() returns the current interleave mask ifthe task's memory allocation policy is page interleaved.Otherwise, this function returns an empty mask.numa_set_interleave_mask() sets the memory interleave mask forthe current task to nodemask.  All new memory allocations arepage interleaved over all nodes in the interleave mask.Interleaving can be turned off again by passing an empty mask(numa_no_nodes).  The page interleaving only occurs on the actualpage fault that puts a new page into the current address space.It is also only a hint: the kernel will fall back to other nodesif no memory is available on the interleave target.numa_interleave_memory() interleaves size bytes of memory page bypage from start on nodes specified in nodemask.  The sizeargument will be rounded up to a multiple of the system pagesize.  If nodemask contains nodes that are externally denied tothis process, this call will fail.  This is a lower levelfunction to interleave allocated but not yet faulted in memory.Not yet faulted in means the memory is allocated using mmap(2) orshmat(2), but has not been accessed by the current process yet.The memory is page interleaved to all nodes specified innodemask.  Normally numa_alloc_interleaved() should be used forprivate memory instead, but this function is useful to handleshared memory areas. To be useful the memory area should beseveral megabytes at least (or tens of megabytes of hugetlbfsmappings) If the numa_set_strict() flag is true then theoperation will cause a numa_error if there were already pages inthe mapping that do not follow the policy.numa_bind() binds the current task and its children to the nodesspecified in nodemask.  They will only run on the CPUs of thespecified nodes and only be able to allocate memory from them.This function is equivalent to callingnuma_run_on_node_mask(nodemask) followed bynuma_set_membind(nodemask).  If tasks should be bound toindividual CPUs inside nodes consider using numa_node_to_cpus andthe sched_setaffinity(2) syscall.numa_set_localalloc() sets the memory allocation policy for thecalling task to local allocation.  In this mode, the preferrednode for memory allocation is effectively the node where the taskis executing at the time of a page allocation.numa_set_membind() sets the memory allocation mask.  The taskwill only allocate memory from the nodes set in nodemask.Passing an empty nodemask or a nodemask that contains nodes otherthan those in the mask returned by numa_get_mems_allowed() willresult in an error.numa_set_membind_balancing() sets the memory allocation mask andenable the Linux kernel NUMA balancing for the task if thefeature is supported by the kernel.  The task will only allocatememory from the nodes set in nodemask.  Passing an empty nodemaskor a nodemask that contains nodes other than those in the maskreturned by numa_get_mems_allowed() will result in an error.numa_get_membind() returns the mask of nodes from which memorycan currently be allocated.  If the returned mask is equal tonuma_all_nodes, then memory allocation is allowed from all nodes.numa_alloc_onnode() allocates memory on a specific node.  Thesize argument will be rounded up to a multiple of the system pagesize.  if the specified node is externally denied to thisprocess, this call will fail.  This function is relatively slowcompared to the malloc(3), family of functions.  The memory mustbe freed with numa_free().  On errors NULL is returned.numa_alloc_local() allocates size bytes of memory on the localnode.  The size argument will be rounded up to a multiple of thesystem page size.  This function is relatively slow compared tothe malloc(3) family of functions.  The memory must be freed withnuma_free().  On errors NULL is returned.numa_alloc_interleaved() allocates size bytes of memory pageinterleaved on all nodes. This function is relatively slow andshould only be used for large areas consisting of multiple pages.The interleaving works at page level and will only show an effectwhen the area is large.  The allocated memory must be freed withnuma_free().  On error, NULL is returned.numa_alloc_interleaved_subset() attempts to allocate size bytesof memory page interleaved on all nodes.  The size argument willbe rounded up to a multiple of the system page size.  The nodeson which a process is allowed to allocate memory may beconstrained externally.  If this is the case, this function mayfail.  This function is relatively slow compare to malloc(3),family of functions and should only be used for large areasconsisting of multiple pages.  The interleaving works at pagelevel and will only show an effect when the area is large.  Theallocated memory must be freed with numa_free().  On error, NULLis returned.numa_alloc() allocates size bytes of memory with the current NUMApolicy.  The size argument will be rounded up to a multiple ofthe system page size.  This function is relatively slow compareto the malloc(3) family of functions.  The memory must be freedwith numa_free().  On errors NULL is returned.numa_realloc() changes the size of the memory area pointed to byold_addr from old_size to new_size.  The memory area pointed toby old_addr must have been allocated with one of the numa_alloc*functions.  The new_size will be rounded up to a multiple of thesystem page size. The contents of the memory area will beunchanged to the minimum of the old and new sizes; newlyallocated memory will be uninitialized. The memory policy (andnode bindings) associated with the original memory area will bepreserved in the resized area. For example, if the initial areawas allocated with a call to numa_alloc_onnode(), then the newpages (if the area is enlarged) will be allocated on the samenode.  However, if no memory policy was set for the originalarea, then numa_realloc() cannot guarantee that the new pageswill be allocated on the same node. On success, the address ofthe resized area is returned (which might be different from thatof the initial area), otherwise NULL is returned and errno is setto indicate the error. The pointer returned by numa_realloc() issuitable for passing to numa_free().numa_free() frees size bytes of memory starting at start,allocated by the numa_alloc_* functions above.  The size argumentwill be rounded up to a multiple of the system page size.numa_run_on_node() runs the current task and its children on aspecific node. They will not migrate to CPUs of other nodes untilthe node affinity is reset with a new call tonuma_run_on_node_mask().  Passing -1 permits the kernel toschedule on all nodes again.  On success, 0 is returned; on error-1 is returned, and errno is set to indicate the error.numa_run_on_node_mask() runs the current task and its childrenonly on nodes specified in nodemask.  They will not migrate toCPUs of other nodes until the node affinity is reset with a newcall to numa_run_on_node_mask() or numa_run_on_node().  Passingnuma_all_nodes permits the kernel to schedule on all nodes again.On success, 0 is returned; on error -1 is returned, and errno isset to indicate the error.numa_run_on_node_mask_all() runs the current task and itschildren only on nodes specified in nodemask likenuma_run_on_node_mask but without any cpuset awareness.numa_get_run_node_mask() returns a mask of CPUs on which thecurrent task is allowed to run.numa_tonode_memory() put memory on a specific node. Theconstraints described for numa_interleave_memory() apply heretoo.numa_tonodemask_memory() put memory on a specific set of nodes.The constraints described for numa_interleave_memory() apply heretoo.numa_setlocal_memory() locates memory on the current node. Theconstraints described for numa_interleave_memory() apply heretoo.numa_police_memory() locates memory with the current NUMA policy.The constraints described for numa_interleave_memory() apply heretoo.numa_distance() reports the distance in the machine topologybetween two nodes.  The factors are a multiple of 10. It returns0 when the distance cannot be determined. A node has distance 10to itself.  Reporting the distance requires a Linux kernelversion of 2.6.10 or newer.numa_set_bind_policy() specifies whether calls that bind memoryto a specific node should use the preferred policy or a strictpolicy.  The preferred policy allows the kernel to allocatememory on other nodes when there isn't enough free on the targetnode. strict will fail the allocation in that case.  Setting theargument to specifies strict, 0 preferred.  Note that specifyingmore than one node non strict may only use the first node in somekernel versions.numa_set_strict() sets a flag that says whether the functionsallocating on specific nodes should use use a strict policy.Strict means the allocation will fail if the memory cannot beallocated on the target node.  Default operation is to fall backto other nodes.  This doesn't apply to interleave and default.numa_get_interleave_node() is used by libnuma internally. It isprobably not useful for user applications.  It uses theMPOL_F_NODE flag of the get_mempolicy system call, which is notintended for application use (its operation may change or beremoved altogether in future kernel versions). Seeget_mempolicy(2).numa_pagesize() returns the number of bytes in page. Thisfunction is simply a fast alternative to repeated calls to thegetpagesize system call.  See getpagesize(2).numa_sched_getaffinity() retrieves a bitmask of the cpus on whicha task may run.  The task is specified by pid.  Returns thereturn value of the sched_getaffinity system call.  Seesched_getaffinity(2).  The bitmask must be at least the size ofthe kernel's cpu mask structure. Use numa_allocate_cpumask() toallocate it.  Test the bits in the mask by callingnuma_bitmask_isbitset().numa_sched_setaffinity() sets a task's allowed cpu's to thosecpu's specified in mask.  The task is specified by pid.  Returnsthe return value of the sched_setaffinity system call.  Seesched_setaffinity(2).  You may allocate the bitmask withnuma_allocate_cpumask().  Or the bitmask may be smaller than thekernel's cpu mask structure. For example, callnuma_bitmask_alloc() using a maximum number of cpus fromnuma_num_configured_cpus().  Set the bits in the mask by callingnuma_bitmask_setbit().numa_node_to_cpus() converts a node number to a bitmask of CPUs.The user must pass a bitmask structure with a mask buffer longenough to represent all possible cpu's.  Usenuma_allocate_cpumask() to create it.  If the bitmask is not longenough errno will be set to ERANGE and -1 returned. On success 0is returned.numa_node_to_cpu_update() Mark cpus bitmask of all nodes stale,then get the latest bitmask by calling numa_node_to_cpus() Thisallows to update the libnuma state after a CPU hotplug event. Theapplication is in charge of detecting CPU hotplug events.numa_node_of_cpu() returns the node that a cpu belongs to. If theuser supplies an invalid cpu errno will be set to EINVAL and -1will be returned.numa_allocate_cpumask () returns a bitmask of a size equal to thekernel's cpu mask (kernel type cpumask_t).  In other words, largeenough to represent NR_CPUS cpus.  This number of cpus can begotten by calling numa_num_possible_cpus().  The bitmask is zero-filled.numa_free_cpumask frees a cpumask previously allocate bynuma_allocate_cpumask.numa_allocate_nodemask() returns a bitmask of a size equal to thekernel's node mask (kernel type nodemask_t).  In other words,large enough to represent MAX_NUMNODES nodes.  This number ofnodes can be gotten by calling numa_num_possible_nodes().  Thebitmask is zero-filled.numa_free_nodemask() frees a nodemask previous allocated bynuma_allocate_nodemask().numa_bitmask_alloc() allocates a bitmask structure and itsassociated bit mask.  The memory allocated for the bit maskcontains enough words (type unsigned long) to contain n bits.The bit mask is zero-filled.  The bitmask structure points to thebit mask and contains the n value.numa_bitmask_clearall() sets all bits in the bit mask to 0.  Thebitmask structure points to the bit mask and contains its size (bmp ->size).  The value of bmp is always returned.  Note thatnuma_bitmask_alloc() creates a zero-filled bit mask.numa_bitmask_clearbit() sets a specified bit in a bit mask to 0.Nothing is done if the n value is greater than the size of thebitmask (and no error is returned). The value of bmp is alwaysreturned.numa_bitmask_equal() returns 1 if two bitmasks are equal.  Itreturns 0 if they are not equal.  If the bitmask structurescontrol bit masks of different sizes, the "missing" trailing bitsof the smaller bit mask are considered to be 0.numa_bitmask_free() deallocates the memory of both the bitmaskstructure pointed to by bmp and the bit mask.  It is an error toattempt to free this bitmask twice.numa_bitmask_isbitset() returns the value of a specified bit in abit mask.  If the n value is greater than the size of the bitmap, 0 is returned.numa_bitmask_nbytes() returns the size (in bytes) of the bit maskcontrolled by bmp.  The bit masks are always full words (typeunsigned long), and the returned size is the actual size of allthose words.numa_bitmask_setall() sets all bits in the bit mask to 1.  Thebitmask structure points to the bit mask and contains its size (bmp ->size).  The value of bmp is always returned.numa_bitmask_setbit() sets a specified bit in a bit mask to 1.Nothing is done if n is greater than the size of the bitmask (andno error is returned). The value of bmp is always returned.copy_bitmask_to_nodemask() copies the body (the bit map itself)of the bitmask structure pointed to by bmp to the nodemask_tstructure pointed to by the nodemask pointer. If the two areasdiffer in size, the copy is truncated to the size of thereceiving field or zero-filled.copy_nodemask_to_bitmask() copies the nodemask_t structurepointed to by the nodemask pointer to the body (the bit mapitself) of the bitmask structure pointed to by the bmp pointer.If the two areas differ in size, the copy is truncated to thesize of the receiving field or zero-filled.copy_bitmask_to_bitmask() copies the body (the bit map itself) ofthe bitmask structure pointed to by the bmpfrom pointer to thebody of the bitmask structure pointed to by the bmpto pointer. Ifthe two areas differ in size, the copy is truncated to the sizeof the receiving field or zero-filled.numa_bitmask_weight() returns a count of the bits that are set inthe body of the bitmask pointed to by the bmp argument.numa_move_pages() moves a list of pages in the address space ofthe currently executing or current process.  It simply uses themove_pages system call.pid - ID of task.  If not valid, use the current task.count - Number of pages.pages - List of pages to move.nodes - List of nodes to which pages can be moved.status - Field to which status is to be returned.flags - MPOL_MF_MOVE or MPOL_MF_MOVE_ALLSee move_pages(2).numa_migrate_pages() simply uses the migrate_pages system call tocause the pages of the calling task, or a specified task, to bemigated from one set of nodes to another.  See migrate_pages(2).The bit masks representing the nodes should be allocated withnuma_allocate_nodemask() , or with numa_bitmask_alloc() using ann value returned from numa_num_possible_nodes().  A task'scurrent node set can be gotten by calling numa_get_membind().Bits in the tonodes mask can be set by calls tonuma_bitmask_setbit().numa_error() is a libnuma internal function that can beoverridden by the user program.  This function is called with achar * argument when a libnuma function fails.  Overriding thelibrary internal definition makes it possible to specify adifferent error handling strategy when a libnuma function fails.It does not affect numa_available().  The numa_error() functiondefined in libnuma prints an error on stderr and terminates theprogram if numa_exit_on_error is set to a non-zero value.  Thedefault value of numa_exit_on_error is zero.numa_warn() is a libnuma internal function that can be alsooverridden by the user program.  It is called to warn the userwhen a libnuma function encounters a non-fatal error.  Thedefault implementation prints a warning to stderr.  The firstargument is a unique number identifying each warning. After thatthere is a printf(3)-style format string and a variable number ofarguments.  numa_warn exits the program when numa_exit_on_warn isset to a non-zero value.  The default value of numa_exit_on_warnis zero.

Compatibility with libnuma version 1

       Binaries that were compiled for libnuma version 1 need not be re-compiled to run with libnuma version 2.Source codes written for libnuma version 1 may be re-compiledwithout change with version 2 installed. To do so, in the code'sMakefile add this option to CFLAGS:-DNUMA_VERSION1_COMPATIBILITY

THREAD SAFETY

       numa_set_bind_policy and numa_exit_on_error are process global.The other calls are thread safe.

COPYRIGHT

       Copyright 2002, 2004, 2007, 2008 Andi Kleen, SuSE Labs.  libnumais under the GNU Lesser General Public License, v2.1.

SEE ALSO

       get_mempolicy(2), set_mempolicy(2), getpagesize(2), mbind(2),mmap(2), shmat(2), numactl(8), sched_getaffinity(2)sched_setaffinity(2) move_pages(2) migrate_pages(2)

COLOPHON

       This page is part of the numactl (NUMA commands) project.Information about the project can be found at 〈http://oss.sgi.com/projects/libnuma/〉.  If you have a bug reportfor this manual page, send it to linux-numa@vger.kernel.org.This page was obtained from the project's upstream Git repository〈https://github.com/numactl/numactl.git〉 on 2021-04-01.  (At thattime, the date of the most recent commit that was found in therepository was 2021-03-31.)  If you discover any renderingproblems in this HTML version of the page, or you believe thereis a better or more up-to-date source for the page, or you havecorrections or improvements to the information in this COLOPHON(which is not part of the original manual page), send a mail toman-pages@man7.orgSuSE Labs                     December 2007                      NUMA(3)

Pages that refer to this page: get_mempolicy(2),  mbind(2),  migrate_pages(2),  move_pages(2),  set_mempolicy(2),  numa(7),  numastat(8)

get_mempolicy(2) /set_mempolicy(2)/mbind(2)/numa(3) — Linux manual page相关推荐

  1. linux 查看numa信息,Linux中查看NUMA信息

    Linux中查看NUMA信息 2015-03-19 本博客所有文章采用的授权方式为 自由转载-非商用-非衍生-保持署名 ,转载请务必注明出处,谢谢. 声明: 本博客欢迎转发,但请保留原作者信息! 新浪 ...

  2. libnuma详解-A NUMA API for LINUX

    参考资料 http://developer.amd.com/wordpress/media/2012/10/LibNUMA-WP-fv1.pdf numa(3) - Linux manual page ...

  3. Linux 存储 Stack详解

    (未完待续,持续更新中) 目录 序言 0 存储设备 0.1 机械盘 0.2 SSD 0.3 NVDIMM 1 VFS 1.0 基础组件 1.0.1 iov_iter 1.0.2 iomap 1.1 i ...

  4. Cpu占用率检测以及 Cpu Burn

    目录 Linux lscpu指令 概念-超线程 概念-sys高的理解: system (sy) user (us) nice (ni) idle (id) iowait (wa) Other stat ...

  5. NUMA全称 Non-Uniform Memory Access,译为“非一致性内存访问”,积极NUMA内存策略

    目录 NUMA的诞生背景 NUMA构架细节 上机演示 NUMA Memory Policy What is NUMA Memory Policy? Memory Policy Concepts Sco ...

  6. NUMA为何成为云计算的关键技术

    作者简介: 鲁班,EasyStack系统工程和产品研发工程师,作为一名OpenStack兼内核开发者,他早在OpenStack Grizzly即加入小区开发,并为OpenStack贡献了可观的代码量. ...

  7. 深度| NUMA为何成为云计算的关键技术

    转载自:https://www.sohu.com/a/129374635_609513 进入21世纪后,计算机的体系结构并没有停止前进的步伐,尤其是在处理器领域所取得的技术突破奠定了包括云计算.大数据 ...

  8. linux系统下如何查看cpu能同时跑几个线程_探讨基于Linux的NUMA系统

    相信我们从事IT基础设施开发的朋友们都听说过NUMA,以前自己也零零散散地听到过一些概念,还仍感不太系统,最近研究的基于scylla的DB时,就发生过内存回收compaction的问题.今日在几篇文章 ...

  9. NUMA架构的CPU

    本文从NUMA的介绍引出常见的NUMA使用中的陷阱,继而讨论对于NUMA系统的优化方法和一些值得关注的方向. 文章欢迎转载,但转载时请保留本段文字,并置于文章的顶部 作者:卢钧轶(cenalulu) ...

最新文章

  1. 【转】 指针函数与函数指针的区别
  2. LeetCode-73. Set Matrix Zeroes
  3. java 头尾 队列_探索JAVA并发 - 并发容器全家福
  4. Android 7.0 Nougat介绍
  5. Css3实现波浪线效果1
  6. 宣布在日本地区正式发布 Windows Azure
  7. opencv:图像的基本变换
  8. TensorFlow实验(1)
  9. 【Python】下载所有 XKCD 漫画
  10. V4L2学习(三)框架分析
  11. 集成灶带给我的是无尽烦恼,大家的集成灶用得如何?
  12. 使用fieldset、label标签制作form表单
  13. android pgis地图,PGIS(警用地图)建设方案详细.doc
  14. 全志A31S源码编译
  15. uni-app(微信小程序)连接HC系列蓝牙模块并进行双向通信采坑总结
  16. 笔记本突然不能连接无线网解决办法
  17. 凯云软件测试项目管理系统系统描述
  18. PBR:基于物理的渲染(Physically Based Rendering)+理论相关
  19. 项目时间管理-知识领域
  20. AI从感知走向智能认知

热门文章

  1. Github 标星 13K+!这可能是最好的 Java 博客系统
  2. 剑指offer25-合并两个排序的链表
  3. sqlserver随机取记录
  4. 团队任务3 每日立会
  5. 搭建了Pycharm对话平台
  6. rss 订阅实现-iOS版
  7. Swift--集合类型 数组 字典 集合
  8. weiphp 简介--笔记
  9. 端口数据[精通WindowsSocket网络开发-基于VC++实现]第二章——TCP/IP简介
  10. android demo 调用,Android中调用C++函数的一个简单Demo