Back to index

numactl  2.0.8~rc4
numaif.h
Go to the documentation of this file.
00001 #ifndef NUMAIF_H
00002 #define NUMAIF_H 1
00003 
00004 #ifdef __cplusplus
00005 extern "C" {
00006 #endif
00007 
00008 /* Kernel interface for NUMA API */
00009 
00010 /* System calls */
00011 extern long get_mempolicy(int *policy, const unsigned long *nmask,
00012                      unsigned long maxnode, void *addr, int flags);
00013 extern long mbind(void *start, unsigned long len, int mode,
00014        const unsigned long *nmask, unsigned long maxnode, unsigned flags);
00015 extern long set_mempolicy(int mode, const unsigned long *nmask,
00016                        unsigned long maxnode);
00017 extern long migrate_pages(int pid, unsigned long maxnode,
00018                        const unsigned long *frommask,
00019                        const unsigned long *tomask);
00020 
00021 extern long move_pages(int pid, unsigned long count,
00022               void **pages, const int *nodes, int *status, int flags);
00023 
00024 /* Policies */
00025 #define MPOL_DEFAULT     0
00026 #define MPOL_PREFERRED    1
00027 #define MPOL_BIND        2
00028 #define MPOL_INTERLEAVE  3
00029 
00030 #define MPOL_MAX MPOL_INTERLEAVE
00031 
00032 /* Flags for get_mem_policy */
00033 #define MPOL_F_NODE    (1<<0)   /* return next il node or node of address */
00034                             /* Warning: MPOL_F_NODE is unsupported and
00035                                subject to change. Don't use. */
00036 #define MPOL_F_ADDR     (1<<1)  /* look up vma using address */
00037 #define MPOL_F_MEMS_ALLOWED (1<<2) /* query nodes allowed in cpuset */
00038 
00039 /* Flags for mbind */
00040 #define MPOL_MF_STRICT  (1<<0)  /* Verify existing pages in the mapping */
00041 #define MPOL_MF_MOVE (1<<1)  /* Move pages owned by this process to conform to mapping */
00042 #define MPOL_MF_MOVE_ALL (1<<2) /* Move every page to conform to mapping */
00043 
00044 #ifdef __cplusplus
00045 }
00046 #endif
00047 
00048 #endif