1
.\" Copyright 2003,2004 Andi Kleen, SuSE Labs.
3
.\" Permission is granted to make and distribute verbatim copies of this
4
.\" manual provided the copyright notice and this permission notice are
5
.\" preserved on all copies.
7
.\" Permission is granted to copy and distribute modified versions of this
8
.\" manual under the conditions for verbatim copying, provided that the
9
.\" entire resulting derived work is distributed under the terms of a
10
.\" permission notice identical to this one.
12
.\" Since the Linux kernel and libraries are constantly changing, this
13
.\" manual page may be incorrect or out-of-date. The author(s) assume no
14
.\" responsibility for errors or omissions, or for damages resulting from
15
.\" the use of the information contained herein.
17
.\" Formatted or processed versions of this manual, if unaccompanied by
18
.\" the source, must acknowledge the copyright and authors of this work.
19
.TH GET_MEMPOLICY "2" "Nov 2003" "SuSE Labs" "Linux Programmer's Manual"
21
get_mempolicy - Retrieve NUMA memory policy for a process
23
.B "#include <numaif.h>"
25
.B int get_mempolicy(int *policy, unsigned long *nodemask, unsigned long maxnode, unsigned long addr, unsigned long flags)
26
.\" TBD rewrite this. it is confusing.
29
retrieves the NUMA policy of the current process or an memory address.
30
A NUMA machine has different
31
memory controllers with different distances to specific CPUs.
32
The memory policy defines in which node memory is allocated for
35
gets the memory policy of the current process. The policy is stored into
37
when not zero, with the associated nodemask stored into
40
is the maximum bit number plus one that can be stored into
42
The bit number is always rounded to an multiple of unsigned long.
45
.\" The other valid flag is
47
.\" It is only valid when the policy is
48
.\" .I MPOL_INTERLEAVE.
49
.\" In this case not the interleave mask, but an unsigned long with the next
50
.\" node that would be used for interleaving is returned in
53
.\" Other flag values are reserved.
55
For an overview of the possible policies see the
61
returns -1 when an error occurred, otherwise 0.
67
Applications should consider using the higher level functions
70
instead. This library is available in the
74
This manpage is not documenting some obscure features
75
that can be enabled using
81
syscall was added to the Linux kernel with version
83
It is only available on kernels compiled with
86
Until glibc supports these system calls you can link with
88
to get system call definitions. libnuma is available in the numactl
89
package. It also has the