1f08c3bdfSopenharmony_ci/* 2f08c3bdfSopenharmony_ci * SPDX-License-Identifier: GPL-2.0-or-later 3f08c3bdfSopenharmony_ci * 4f08c3bdfSopenharmony_ci * Copyright (c) 2018 Cyril Hrubis <chrubis@suse.cz> 5f08c3bdfSopenharmony_ci */ 6f08c3bdfSopenharmony_ci 7f08c3bdfSopenharmony_ci#ifndef SET_MEMPOLICY_H__ 8f08c3bdfSopenharmony_ci#define SET_MEMPOLICY_H__ 9f08c3bdfSopenharmony_ci 10f08c3bdfSopenharmony_cistatic inline void alloc_fault_count(struct tst_nodemap *nodes, 11f08c3bdfSopenharmony_ci const char *file, size_t size) 12f08c3bdfSopenharmony_ci{ 13f08c3bdfSopenharmony_ci void *ptr; 14f08c3bdfSopenharmony_ci 15f08c3bdfSopenharmony_ci ptr = tst_numa_map(file, size); 16f08c3bdfSopenharmony_ci tst_numa_fault(ptr, size); 17f08c3bdfSopenharmony_ci tst_nodemap_count_pages(nodes, ptr, size); 18f08c3bdfSopenharmony_ci tst_numa_unmap(ptr, size); 19f08c3bdfSopenharmony_ci} 20f08c3bdfSopenharmony_ci 21f08c3bdfSopenharmony_ci#endif /* SET_MEMPOLICY_H__ */ 22