brintos

brintos / linux-shallow public Read only

0
0
Text · 1.6 KiB · b020547 Raw
56 lines · c
1/* SPDX-License-Identifier: GPL-2.0-only */2/*3 * tools/testing/selftests/kvm/include/numaif.h4 *5 * Copyright (C) 2020, Google LLC.6 *7 * This work is licensed under the terms of the GNU GPL, version 2.8 *9 * Header file that provides access to NUMA API functions not explicitly10 * exported to user space.11 */12 13#ifndef SELFTEST_KVM_NUMAIF_H14#define SELFTEST_KVM_NUMAIF_H15 16#define __NR_get_mempolicy 23917#define __NR_migrate_pages 25618 19/* System calls */20long get_mempolicy(int *policy, const unsigned long *nmask,21		   unsigned long maxnode, void *addr, int flags)22{23	return syscall(__NR_get_mempolicy, policy, nmask,24		       maxnode, addr, flags);25}26 27long migrate_pages(int pid, unsigned long maxnode,28		   const unsigned long *frommask,29		   const unsigned long *tomask)30{31	return syscall(__NR_migrate_pages, pid, maxnode, frommask, tomask);32}33 34/* Policies */35#define MPOL_DEFAULT	 036#define MPOL_PREFERRED	 137#define MPOL_BIND	 238#define MPOL_INTERLEAVE	 339 40#define MPOL_MAX MPOL_INTERLEAVE41 42/* Flags for get_mem_policy */43#define MPOL_F_NODE	    (1<<0)  /* return next il node or node of address */44				    /* Warning: MPOL_F_NODE is unsupported and45				     * subject to change. Don't use.46				     */47#define MPOL_F_ADDR	    (1<<1)  /* look up vma using address */48#define MPOL_F_MEMS_ALLOWED (1<<2)  /* query nodes allowed in cpuset */49 50/* Flags for mbind */51#define MPOL_MF_STRICT	     (1<<0) /* Verify existing pages in the mapping */52#define MPOL_MF_MOVE	     (1<<1) /* Move pages owned by this process to conform to mapping */53#define MPOL_MF_MOVE_ALL     (1<<2) /* Move every page to conform to mapping */54 55#endif /* SELFTEST_KVM_NUMAIF_H */56