From d649d6fc2d6bb912f60c4c7c64f883e98d6ef7ef Mon Sep 17 00:00:00 2001 From: Katsuya Horigome Date: Mon, 6 Nov 2017 12:47:56 +0900 Subject: [PATCH] Include mbind support (this is a rebase commit to merge into development) --- kernel/devobj.c | 2 +- kernel/fileobj.c | 30 +-- kernel/host.c | 4 +- kernel/include/memobj.h | 8 +- kernel/include/process.h | 4 +- kernel/include/syscall.h | 1 + kernel/mem.c | 61 ++++- kernel/process.c | 16 +- kernel/shmobj.c | 4 +- kernel/syscall.c | 130 +++++++---- kernel/zeroobj.c | 2 +- lib/include/ihk/mm.h | 22 +- test/mbind/README | 19 ++ test/mbind/chk_mbind_result.sh | 58 +++++ test/mbind/config | 3 + test/mbind/go_mbind_test.sh | 26 +++ test/mbind/mbind_test.sh | 47 ++++ test/mbind/mcexec_test_proc/Makefile | 7 + .../exec_setmempolicy_mbind.c | 208 ++++++++++++++++++ .../exec_setmempolicy_mbind_shared.c | 208 ++++++++++++++++++ test/mbind/result/.gitignore | 0 test/mbind/test_trace_mem.patch | 75 +++++++ test/mbind/testcases/0001_mbind.txt | 6 + test/mbind/testcases/0002_mbind.txt | 6 + test/mbind/testcases/0003_mbind.txt | 6 + test/mbind/testcases/0004_mbind.txt | 6 + test/mbind/testcases/0005_mbind.txt | 6 + test/mbind/testcases/0006_mbind.txt | 6 + test/mbind/testcases/0007_mbind.txt | 6 + test/mbind/testcases/0008_mbind.txt | 6 + test/mbind/testcases/0009_mbind.txt | 6 + test/mbind/testcases/0010_mbind.txt | 6 + test/mbind/testcases/0011_mbind.txt | 6 + test/mbind/testcases/0012_mbind.txt | 6 + test/mbind/testcases/0013_mbind.txt | 6 + test/mbind/testcases/0014_mbind.txt | 6 + test/mbind/testcases/0015_mbind.txt | 6 + test/mbind/testcases/0016_mbind.txt | 6 + test/mbind/testcases/0017_mbind.txt | 6 + test/mbind/testcases/0018_mbind.txt | 6 + test/mbind/testcases/0019_mbind.txt | 6 + test/mbind/testcases/0020_mbind.txt | 6 + test/mbind/testcases/0021_mbind.txt | 6 + test/mbind/testcases/0022_mbind.txt | 6 + test/mbind/testcases/0023_mbind.txt | 6 + test/mbind/testcases/0024_mbind.txt | 6 + test/mbind/testcases/0025_mbind.txt | 6 + test/mbind/testcases/0026_mbind.txt | 6 + test/mbind/testcases/0027_mbind.txt | 6 + test/mbind/testcases/0028_mbind.txt | 6 + test/mbind/testcases/0029_mbind.txt | 6 + test/mbind/testcases/0030_mbind.txt | 6 + test/mbind/testcases/0031_mbind.txt | 6 + test/mbind/testcases/0032_mbind.txt | 6 + test/mbind/testcases/0033_mbind.txt | 6 + test/mbind/testcases/0034_mbind.txt | 6 + test/mbind/testcases/0035_mbind.txt | 6 + test/mbind/testcases/0036_mbind.txt | 6 + test/mbind/testcases/0037_mbind.txt | 6 + test/mbind/testcases/0038_mbind.txt | 6 + test/mbind/testcases/0039_mbind.txt | 6 + test/mbind/testcases/0040_mbind.txt | 6 + test/mbind/testcases/0041_mbind.txt | 6 + test/mbind/testcases/0042_mbind.txt | 6 + test/mbind/testcases/0043_mbind.txt | 6 + test/mbind/testcases/0044_mbind.txt | 6 + test/mbind/testcases/0045_mbind.txt | 6 + test/mbind/testcases/0046_mbind.txt | 6 + test/mbind/testcases/0047_mbind.txt | 6 + test/mbind/testcases/0048_mbind.txt | 6 + test/mbind/testcases/0049_mbind.txt | 6 + test/mbind/testcases/0050_mbind.txt | 6 + test/mbind/testcases/0051_mbind.txt | 6 + test/mbind/testcases/0052_mbind.txt | 6 + test/mbind/testcases/0053_mbind.txt | 6 + test/mbind/testcases/0054_mbind.txt | 6 + test/mbind/testcases/0055_mbind.txt | 6 + test/mbind/testcases/0056_mbind.txt | 6 + test/mbind/testcases/0057_mbind.txt | 6 + test/mbind/testcases/0058_mbind.txt | 6 + test/mbind/testcases/0059_mbind.txt | 6 + test/mbind/testcases/0060_mbind.txt | 6 + test/mbind/testcases/0061_mbind.txt | 6 + test/mbind/testcases/0062_mbind.txt | 6 + test/mbind/testcases/0063_mbind.txt | 6 + test/mbind/testcases/0064_mbind.txt | 6 + test/mbind/testcases/0065_mbind.txt | 6 + test/mbind/testcases/0066_mbind.txt | 6 + test/mbind/testcases/0067_mbind.txt | 6 + test/mbind/testcases/0068_mbind.txt | 6 + test/mbind/testcases/0069_mbind.txt | 6 + test/mbind/testcases/0070_mbind.txt | 6 + test/mbind/testcases/0071_mbind.txt | 6 + test/mbind/testcases/0072_mbind.txt | 6 + test/mbind/testcases/0073_mbind.txt | 6 + test/mbind/testcases/0074_mbind.txt | 6 + test/mbind/testcases/0075_mbind.txt | 6 + test/mbind/testcases/0076_mbind.txt | 6 + test/mbind/testcases/0077_mbind.txt | 6 + test/mbind/testcases/0078_mbind.txt | 6 + test/mbind/testcases/0079_mbind.txt | 6 + test/mbind/testcases/0080_mbind.txt | 6 + test/mbind/testcases/0081_mbind.txt | 6 + test/mbind/testcases/0082_mbind.txt | 6 + test/mbind/testcases/0083_mbind.txt | 6 + test/mbind/testcases/0084_mbind.txt | 6 + test/mbind/testcases/0085_mbind.txt | 6 + test/mbind/testcases/0086_mbind.txt | 6 + test/mbind/testcases/0087_mbind.txt | 6 + test/mbind/testcases/0088_mbind.txt | 6 + test/mbind/testcases/0089_mbind.txt | 6 + test/mbind/testcases/0090_mbind.txt | 6 + test/mbind/testcases/0091_mbind.txt | 6 + test/mbind/testcases/0092_mbind.txt | 6 + test/mbind/testcases/0093_mbind.txt | 6 + test/mbind/testcases/0094_mbind.txt | 6 + test/mbind/testcases/0095_mbind.txt | 6 + test/mbind/testcases/0096_mbind.txt | 6 + test/mbind/testcases/0097_mbind.txt | 6 + test/mbind/testcases/0098_mbind.txt | 6 + test/mbind/testcases/0099_mbind.txt | 6 + test/mbind/testcases/0100_mbind.txt | 6 + test/mbind/utils/gen_mem_chunks.sh | 16 ++ test/mbind/utils/kill_mcexec.sh | 10 + 124 files changed, 1458 insertions(+), 103 deletions(-) create mode 100644 test/mbind/README create mode 100755 test/mbind/chk_mbind_result.sh create mode 100755 test/mbind/config create mode 100755 test/mbind/go_mbind_test.sh create mode 100755 test/mbind/mbind_test.sh create mode 100644 test/mbind/mcexec_test_proc/Makefile create mode 100644 test/mbind/mcexec_test_proc/exec_setmempolicy_mbind.c create mode 100644 test/mbind/mcexec_test_proc/exec_setmempolicy_mbind_shared.c create mode 100644 test/mbind/result/.gitignore create mode 100644 test/mbind/test_trace_mem.patch create mode 100644 test/mbind/testcases/0001_mbind.txt create mode 100644 test/mbind/testcases/0002_mbind.txt create mode 100644 test/mbind/testcases/0003_mbind.txt create mode 100644 test/mbind/testcases/0004_mbind.txt create mode 100644 test/mbind/testcases/0005_mbind.txt create mode 100644 test/mbind/testcases/0006_mbind.txt create mode 100644 test/mbind/testcases/0007_mbind.txt create mode 100644 test/mbind/testcases/0008_mbind.txt create mode 100644 test/mbind/testcases/0009_mbind.txt create mode 100644 test/mbind/testcases/0010_mbind.txt create mode 100644 test/mbind/testcases/0011_mbind.txt create mode 100644 test/mbind/testcases/0012_mbind.txt create mode 100644 test/mbind/testcases/0013_mbind.txt create mode 100644 test/mbind/testcases/0014_mbind.txt create mode 100644 test/mbind/testcases/0015_mbind.txt create mode 100644 test/mbind/testcases/0016_mbind.txt create mode 100644 test/mbind/testcases/0017_mbind.txt create mode 100644 test/mbind/testcases/0018_mbind.txt create mode 100644 test/mbind/testcases/0019_mbind.txt create mode 100644 test/mbind/testcases/0020_mbind.txt create mode 100644 test/mbind/testcases/0021_mbind.txt create mode 100644 test/mbind/testcases/0022_mbind.txt create mode 100644 test/mbind/testcases/0023_mbind.txt create mode 100644 test/mbind/testcases/0024_mbind.txt create mode 100644 test/mbind/testcases/0025_mbind.txt create mode 100644 test/mbind/testcases/0026_mbind.txt create mode 100644 test/mbind/testcases/0027_mbind.txt create mode 100644 test/mbind/testcases/0028_mbind.txt create mode 100644 test/mbind/testcases/0029_mbind.txt create mode 100644 test/mbind/testcases/0030_mbind.txt create mode 100644 test/mbind/testcases/0031_mbind.txt create mode 100644 test/mbind/testcases/0032_mbind.txt create mode 100644 test/mbind/testcases/0033_mbind.txt create mode 100644 test/mbind/testcases/0034_mbind.txt create mode 100644 test/mbind/testcases/0035_mbind.txt create mode 100644 test/mbind/testcases/0036_mbind.txt create mode 100644 test/mbind/testcases/0037_mbind.txt create mode 100644 test/mbind/testcases/0038_mbind.txt create mode 100644 test/mbind/testcases/0039_mbind.txt create mode 100644 test/mbind/testcases/0040_mbind.txt create mode 100644 test/mbind/testcases/0041_mbind.txt create mode 100644 test/mbind/testcases/0042_mbind.txt create mode 100644 test/mbind/testcases/0043_mbind.txt create mode 100644 test/mbind/testcases/0044_mbind.txt create mode 100644 test/mbind/testcases/0045_mbind.txt create mode 100644 test/mbind/testcases/0046_mbind.txt create mode 100644 test/mbind/testcases/0047_mbind.txt create mode 100644 test/mbind/testcases/0048_mbind.txt create mode 100644 test/mbind/testcases/0049_mbind.txt create mode 100644 test/mbind/testcases/0050_mbind.txt create mode 100644 test/mbind/testcases/0051_mbind.txt create mode 100644 test/mbind/testcases/0052_mbind.txt create mode 100644 test/mbind/testcases/0053_mbind.txt create mode 100644 test/mbind/testcases/0054_mbind.txt create mode 100644 test/mbind/testcases/0055_mbind.txt create mode 100644 test/mbind/testcases/0056_mbind.txt create mode 100644 test/mbind/testcases/0057_mbind.txt create mode 100644 test/mbind/testcases/0058_mbind.txt create mode 100644 test/mbind/testcases/0059_mbind.txt create mode 100644 test/mbind/testcases/0060_mbind.txt create mode 100644 test/mbind/testcases/0061_mbind.txt create mode 100644 test/mbind/testcases/0062_mbind.txt create mode 100644 test/mbind/testcases/0063_mbind.txt create mode 100644 test/mbind/testcases/0064_mbind.txt create mode 100644 test/mbind/testcases/0065_mbind.txt create mode 100644 test/mbind/testcases/0066_mbind.txt create mode 100644 test/mbind/testcases/0067_mbind.txt create mode 100644 test/mbind/testcases/0068_mbind.txt create mode 100644 test/mbind/testcases/0069_mbind.txt create mode 100644 test/mbind/testcases/0070_mbind.txt create mode 100644 test/mbind/testcases/0071_mbind.txt create mode 100644 test/mbind/testcases/0072_mbind.txt create mode 100644 test/mbind/testcases/0073_mbind.txt create mode 100644 test/mbind/testcases/0074_mbind.txt create mode 100644 test/mbind/testcases/0075_mbind.txt create mode 100644 test/mbind/testcases/0076_mbind.txt create mode 100644 test/mbind/testcases/0077_mbind.txt create mode 100644 test/mbind/testcases/0078_mbind.txt create mode 100644 test/mbind/testcases/0079_mbind.txt create mode 100644 test/mbind/testcases/0080_mbind.txt create mode 100644 test/mbind/testcases/0081_mbind.txt create mode 100644 test/mbind/testcases/0082_mbind.txt create mode 100644 test/mbind/testcases/0083_mbind.txt create mode 100644 test/mbind/testcases/0084_mbind.txt create mode 100644 test/mbind/testcases/0085_mbind.txt create mode 100644 test/mbind/testcases/0086_mbind.txt create mode 100644 test/mbind/testcases/0087_mbind.txt create mode 100644 test/mbind/testcases/0088_mbind.txt create mode 100644 test/mbind/testcases/0089_mbind.txt create mode 100644 test/mbind/testcases/0090_mbind.txt create mode 100644 test/mbind/testcases/0091_mbind.txt create mode 100644 test/mbind/testcases/0092_mbind.txt create mode 100644 test/mbind/testcases/0093_mbind.txt create mode 100644 test/mbind/testcases/0094_mbind.txt create mode 100644 test/mbind/testcases/0095_mbind.txt create mode 100644 test/mbind/testcases/0096_mbind.txt create mode 100644 test/mbind/testcases/0097_mbind.txt create mode 100644 test/mbind/testcases/0098_mbind.txt create mode 100644 test/mbind/testcases/0099_mbind.txt create mode 100644 test/mbind/testcases/0100_mbind.txt create mode 100755 test/mbind/utils/gen_mem_chunks.sh create mode 100755 test/mbind/utils/kill_mcexec.sh diff --git a/kernel/devobj.c b/kernel/devobj.c index ad687f4e..1998d6fd 100644 --- a/kernel/devobj.c +++ b/kernel/devobj.c @@ -225,7 +225,7 @@ static void devobj_release(struct memobj *memobj) return; } -static int devobj_get_page(struct memobj *memobj, off_t off, int p2align, uintptr_t *physp, unsigned long *flag) +static int devobj_get_page(struct memobj *memobj, off_t off, int p2align, uintptr_t *physp, unsigned long *flag, uintptr_t virt_addr) { const off_t pgoff = off / PAGE_SIZE; struct devobj *obj = to_devobj(memobj); diff --git a/kernel/fileobj.c b/kernel/fileobj.c index b6470fa1..c2e26a05 100644 --- a/kernel/fileobj.c +++ b/kernel/fileobj.c @@ -191,7 +191,7 @@ static struct fileobj *obj_list_lookup(uintptr_t handle) /*********************************************************************** * fileobj */ -int fileobj_create(int fd, struct memobj **objp, int *maxprotp) +int fileobj_create(int fd, struct memobj **objp, int *maxprotp, uintptr_t virt_addr) { ihk_mc_user_context_t ctx; struct pager_create_result result __attribute__((aligned(64))); @@ -265,7 +265,7 @@ int fileobj_create(int fd, struct memobj **objp, int *maxprotp) /* Get the actual pages NUMA interleaved */ for (j = 0; j < nr_pages; ++j) { mo->pages[j] = ihk_mc_alloc_aligned_pages_node_user(1, - PAGE_P2ALIGN, IHK_MC_AP_NOWAIT, node); + PAGE_P2ALIGN, IHK_MC_AP_NOWAIT, node, virt_addr); if (!mo->pages[j]) { kprintf("%s: ERROR: allocating pages[%d]\n", __FUNCTION__, j); @@ -558,7 +558,7 @@ out: } static int fileobj_get_page(struct memobj *memobj, off_t off, - int p2align, uintptr_t *physp, unsigned long *pflag) + int p2align, uintptr_t *physp, unsigned long *pflag, uintptr_t virt_addr) { struct thread *proc = cpu_local_var(current); struct fileobj *obj = to_fileobj(memobj); @@ -571,7 +571,7 @@ static int fileobj_get_page(struct memobj *memobj, off_t off, struct mcs_rwlock_node mcs_node; int hash = (off >> PAGE_SHIFT) & FILEOBJ_PAGE_HASH_MASK; - dkprintf("fileobj_get_page(%p,%lx,%x,%p)\n", obj, off, p2align, physp); + dkprintf("fileobj_get_page(%p,%lx,%x,%x,%p)\n", obj, off, p2align, virt_addr, physp); if (p2align != PAGE_P2ALIGN) { return -ENOMEM; } @@ -584,13 +584,13 @@ static int fileobj_get_page(struct memobj *memobj, off_t off, int page_ind = off >> PAGE_SHIFT; if (!memobj->pages[page_ind]) { - virt = ihk_mc_alloc_pages_user(1, IHK_MC_AP_NOWAIT | IHK_MC_AP_USER); + virt = ihk_mc_alloc_pages_user(1, IHK_MC_AP_NOWAIT | IHK_MC_AP_USER, virt_addr); if (!virt) { error = -ENOMEM; - kprintf("fileobj_get_page(%p,%lx,%x,%p):" + kprintf("fileobj_get_page(%p,%lx,%x,%x,%x,%p):" "alloc failed. %d\n", - obj, off, p2align, physp, + obj, off, p2align, virt_addr, physp, error); goto out_nolock; } @@ -627,22 +627,22 @@ static int fileobj_get_page(struct memobj *memobj, off_t off, args = kmalloc(sizeof(*args), IHK_MC_AP_NOWAIT); if (!args) { error = -ENOMEM; - kprintf("fileobj_get_page(%p,%lx,%x,%p):" + kprintf("fileobj_get_page(%p,%lx,%x,%x,%p):" "kmalloc failed. %d\n", - obj, off, p2align, physp, error); + obj, off, p2align, virt_addr, physp, error); goto out; } if (!page) { npages = 1 << p2align; - virt = ihk_mc_alloc_pages_user(npages, IHK_MC_AP_NOWAIT | - (to_memobj(obj)->flags & MF_ZEROFILL) ? IHK_MC_AP_USER : 0); + virt = ihk_mc_alloc_pages_user(npages, (IHK_MC_AP_NOWAIT | + (to_memobj(obj)->flags & MF_ZEROFILL) ? IHK_MC_AP_USER : 0), virt_addr); if (!virt) { error = -ENOMEM; - kprintf("fileobj_get_page(%p,%lx,%x,%p):" + kprintf("fileobj_get_page(%p,%lx,%x,%x,%p):" "alloc failed. %d\n", - obj, off, p2align, physp, + obj, off, p2align, virt_addr, physp, error); goto out; } @@ -707,8 +707,8 @@ out_nolock: if (args) { kfree(args); } - dkprintf("fileobj_get_page(%p,%lx,%x,%p): %d %lx\n", - obj, off, p2align, physp, error, phys); + dkprintf("fileobj_get_page(%p,%lx,%x,%x,%p): %d %lx\n", + obj, off, p2align, virt_addr, physp, error, phys); return error; } diff --git a/kernel/host.c b/kernel/host.c index c9d2759f..5a7879e3 100644 --- a/kernel/host.c +++ b/kernel/host.c @@ -148,7 +148,7 @@ int prepare_process_ranges_args_envs(struct thread *thread, } if ((up_v = ihk_mc_alloc_pages_user(range_npages, - IHK_MC_AP_NOWAIT | ap_flags)) == NULL) { + IHK_MC_AP_NOWAIT | ap_flags, s)) == NULL) { kprintf("ERROR: alloc pages for ELF section %i\n", i); goto err; } @@ -259,7 +259,7 @@ int prepare_process_ranges_args_envs(struct thread *thread, e = addr + PAGE_SIZE * ARGENV_PAGE_COUNT; if((args_envs = ihk_mc_alloc_pages_user(ARGENV_PAGE_COUNT, - IHK_MC_AP_NOWAIT)) == NULL){ + IHK_MC_AP_NOWAIT, -1)) == NULL){ kprintf("ERROR: allocating pages for args/envs\n"); goto err; } diff --git a/kernel/include/memobj.h b/kernel/include/memobj.h index ad649db0..beb344d1 100644 --- a/kernel/include/memobj.h +++ b/kernel/include/memobj.h @@ -65,7 +65,7 @@ struct memobj { typedef void memobj_release_func_t(struct memobj *obj); typedef void memobj_ref_func_t(struct memobj *obj); -typedef int memobj_get_page_func_t(struct memobj *obj, off_t off, int p2align, uintptr_t *physp, unsigned long *flag); +typedef int memobj_get_page_func_t(struct memobj *obj, off_t off, int p2align, uintptr_t *physp, unsigned long *flag, uintptr_t virt_addr); typedef uintptr_t memobj_copy_page_func_t(struct memobj *obj, uintptr_t orgphys, int p2align); typedef int memobj_flush_page_func_t(struct memobj *obj, uintptr_t phys, size_t pgsize); typedef int memobj_invalidate_page_func_t(struct memobj *obj, uintptr_t phys, size_t pgsize); @@ -96,10 +96,10 @@ static inline void memobj_ref(struct memobj *obj) } static inline int memobj_get_page(struct memobj *obj, off_t off, - int p2align, uintptr_t *physp, unsigned long *pflag) + int p2align, uintptr_t *physp, unsigned long *pflag, uintptr_t virt_addr) { if (obj->ops->get_page) { - return (*obj->ops->get_page)(obj, off, p2align, physp, pflag); + return (*obj->ops->get_page)(obj, off, p2align, physp, pflag, virt_addr); } return -ENXIO; } @@ -159,7 +159,7 @@ static inline int memobj_is_removable(struct memobj *obj) return !!(obj->flags & MF_IS_REMOVABLE); } -int fileobj_create(int fd, struct memobj **objp, int *maxprotp); +int fileobj_create(int fd, struct memobj **objp, int *maxprotp, uintptr_t virt_addr); struct shmid_ds; int shmobj_create(struct shmid_ds *ds, struct memobj **objp); int zeroobj_create(struct memobj **objp); diff --git a/kernel/include/process.h b/kernel/include/process.h index 5f81d269..432289fe 100644 --- a/kernel/include/process.h +++ b/kernel/include/process.h @@ -390,7 +390,7 @@ struct vm_range { }; struct vm_range_numa_policy { - struct list_head list; + struct rb_node policy_rb_node; unsigned long start, end; DECLARE_BITMAP(numa_mask, PROCESS_NUMA_MASK_BITS); int numa_mem_policy; @@ -725,7 +725,7 @@ struct process_vm { DECLARE_BITMAP(numa_mask, PROCESS_NUMA_MASK_BITS); int numa_mem_policy; /* Protected by memory_range_lock */ - struct list_head vm_range_numa_policy_list; + struct rb_root vm_range_numa_policy_tree; struct vm_range *range_cache[VM_RANGE_CACHE_SIZE]; int range_cache_ind; struct swapinfo *swapinfo; diff --git a/kernel/include/syscall.h b/kernel/include/syscall.h index bb728ec8..6e486ae1 100644 --- a/kernel/include/syscall.h +++ b/kernel/include/syscall.h @@ -471,6 +471,7 @@ int arch_map_vdso(struct process_vm *vm); /* arch dependent */ int arch_setup_vdso(void); int arch_cpu_read_write_register(struct ihk_os_cpu_register *desc, enum mcctrl_os_cpu_operation op); +struct vm_range_numa_policy *vm_range_policy_search(struct process_vm *vm, uintptr_t addr); #ifndef POSTK_DEBUG_ARCH_DEP_52 #define VDSO_MAXPAGES 2 diff --git a/kernel/mem.c b/kernel/mem.c index c6c780e0..62cb2065 100644 --- a/kernel/mem.c +++ b/kernel/mem.c @@ -76,7 +76,7 @@ static void *___kmalloc(int size, ihk_mc_ap_flag flag); static void ___kfree(void *ptr); static void *___ihk_mc_alloc_aligned_pages_node(int npages, - int p2align, ihk_mc_ap_flag flag, int node, int is_user); + int p2align, ihk_mc_ap_flag flag, int node, int is_user, uintptr_t virt_addr); static void *___ihk_mc_alloc_pages(int npages, ihk_mc_ap_flag flag, int is_user); static void ___ihk_mc_free_pages(void *p, int npages, int is_user); @@ -193,7 +193,7 @@ struct pagealloc_track_entry *__pagealloc_track_find_entry( /* Top level routines called from macros */ void *_ihk_mc_alloc_aligned_pages_node(int npages, int p2align, - ihk_mc_ap_flag flag, int node, int is_user, + ihk_mc_ap_flag flag, int node, int is_user, uintptr_t virt_addr, char *file, int line) { unsigned long irqflags; @@ -201,7 +201,7 @@ void *_ihk_mc_alloc_aligned_pages_node(int npages, int p2align, struct pagealloc_track_addr_entry *addr_entry; int hash, addr_hash; void *r = ___ihk_mc_alloc_aligned_pages_node(npages, - p2align, flag, node, is_user); + p2align, flag, node, is_user, virt_addr); if (!memdebug || !pagealloc_track_initialized) return r; @@ -497,10 +497,10 @@ void pagealloc_memcheck(void) /* Actual allocation routines */ static void *___ihk_mc_alloc_aligned_pages_node(int npages, int p2align, - ihk_mc_ap_flag flag, int node, int is_user) + ihk_mc_ap_flag flag, int node, int is_user, uintptr_t virt_addr) { if (pa_ops) - return pa_ops->alloc_page(npages, p2align, flag, node, is_user); + return pa_ops->alloc_page(npages, p2align, flag, node, is_user, virt_addr); else return early_alloc_pages(npages); } @@ -508,7 +508,7 @@ static void *___ihk_mc_alloc_aligned_pages_node(int npages, int p2align, static void *___ihk_mc_alloc_pages(int npages, ihk_mc_ap_flag flag, int is_user) { - return ___ihk_mc_alloc_aligned_pages_node(npages, PAGE_P2ALIGN, flag, -1, is_user); + return ___ihk_mc_alloc_aligned_pages_node(npages, PAGE_P2ALIGN, flag, -1, is_user, -1); } static void ___ihk_mc_free_pages(void *p, int npages, int is_user) @@ -544,7 +544,7 @@ static void reserve_pages(struct ihk_page_allocator_desc *pa_allocator, extern int cpu_local_var_initialized; static void *mckernel_allocate_aligned_pages_node(int npages, int p2align, - ihk_mc_ap_flag flag, int pref_node, int is_user) + ihk_mc_ap_flag flag, int pref_node, int is_user, uintptr_t virt_addr) { unsigned long pa = 0; int i, node; @@ -553,6 +553,12 @@ static void *mckernel_allocate_aligned_pages_node(int npages, int p2align, #endif int numa_id; + struct vm_range_numa_policy *range_policy_iter = NULL; + int numa_mem_policy = -1; + struct process_vm *vm; + struct vm_range *range = NULL; + int chk_shm = 0; + if(npages <= 0) return NULL; @@ -565,7 +571,23 @@ static void *mckernel_allocate_aligned_pages_node(int npages, int p2align, /* No explicitly requested NUMA or user policy? */ if ((pref_node == -1) && (!(flag & IHK_MC_AP_USER) || cpu_local_var(current)->vm->numa_mem_policy == MPOL_DEFAULT)) { - goto distance_based; + + if (virt_addr != -1) { + vm = cpu_local_var(current)->vm; + range_policy_iter = vm_range_policy_search(vm, virt_addr); + if (range_policy_iter) { + range = lookup_process_memory_range(vm, (uintptr_t)virt_addr, ((uintptr_t)virt_addr) + 1); + if (range) { + if( (range->memobj) && (range->memobj->flags == MF_SHM)) { + chk_shm = 1; + } + } + } + } + + + if ((!((range_policy_iter) && (range_policy_iter->numa_mem_policy != MPOL_DEFAULT))) && (chk_shm == 0)) + goto distance_based; } node = ihk_mc_get_numa_id(); @@ -611,7 +633,28 @@ static void *mckernel_allocate_aligned_pages_node(int npages, int p2align, } } - switch (cpu_local_var(current)->vm->numa_mem_policy) { + if ((virt_addr != -1) && (chk_shm == 0)) { + + vm = cpu_local_var(current)->vm; + + if (!(range_policy_iter)) { + range_policy_iter = vm_range_policy_search(vm, virt_addr); + } + + if (range_policy_iter) { + range = lookup_process_memory_range(vm, (uintptr_t)virt_addr, ((uintptr_t)virt_addr) + 1); + if ((range && (range->memobj->flags == MF_SHM))) { + chk_shm = 1; + } else { + numa_mem_policy = range_policy_iter->numa_mem_policy; + } + } + } + + if (numa_mem_policy == -1) + numa_mem_policy = cpu_local_var(current)->vm->numa_mem_policy; + + switch (numa_mem_policy) { case MPOL_BIND: case MPOL_PREFERRED: diff --git a/kernel/process.c b/kernel/process.c index 78e5c17a..2bfff206 100644 --- a/kernel/process.c +++ b/kernel/process.c @@ -256,7 +256,7 @@ init_process_vm(struct process *owner, struct address_space *asp, struct process ihk_atomic_set(&vm->refcount, 1); vm->vm_range_tree = RB_ROOT; - INIT_LIST_HEAD(&vm->vm_range_numa_policy_list); + vm->vm_range_numa_policy_tree = RB_ROOT; vm->address_space = asp; vm->proc = owner; vm->exiting = 0; @@ -646,7 +646,7 @@ static int copy_user_pte(void *arg0, page_table_t src_pt, pte_t *src_ptep, void npages = pgsize / PAGE_SIZE; virt = ihk_mc_alloc_aligned_pages_user(npages, pgalign, - IHK_MC_AP_NOWAIT); + IHK_MC_AP_NOWAIT, (uintptr_t)pgaddr); if (!virt) { kprintf("ERROR: copy_user_pte() allocating new page\n"); error = -ENOMEM; @@ -1765,7 +1765,7 @@ static int page_fault_process_memory_range(struct process_vm *vm, struct vm_rang off = pte_get_off(ptep, pgsize); } error = memobj_get_page(range->memobj, off, p2align, - &phys, &memobj_flag); + &phys, &memobj_flag, fault_addr); if (error) { struct memobj *obj; @@ -1787,7 +1787,7 @@ retry: npages = pgsize / PAGE_SIZE; virt = ihk_mc_alloc_aligned_pages_user(npages, p2align, IHK_MC_AP_NOWAIT | - (range->flag & VR_AP_USER) ? IHK_MC_AP_USER : 0); + ((range->flag & VR_AP_USER) ? IHK_MC_AP_USER : 0), fault_addr); if (!virt && !range->pgshift && (pgsize != PAGE_SIZE)) { error = arch_get_smaller_page_size(NULL, pgsize, &pgsize, &p2align); if (error) { @@ -1847,7 +1847,7 @@ retry: npages = pgsize / PAGE_SIZE; virt = ihk_mc_alloc_aligned_pages_user(npages, p2align, - IHK_MC_AP_NOWAIT); + IHK_MC_AP_NOWAIT, fault_addr); if (!virt) { error = -ENOMEM; kprintf("page_fault_process_memory_range(%p,%lx-%lx %lx,%lx,%lx):cannot allocate copy page. %d\n", vm, range->start, range->end, range->flag, fault_addr, reason, error); @@ -2156,7 +2156,7 @@ int init_process_stack(struct thread *thread, struct program_load_desc *pn, ap_flag ? "(IHK_MC_AP_USER)" : ""); stack = ihk_mc_alloc_aligned_pages_user(minsz >> PAGE_SHIFT, - LARGE_PAGE_P2ALIGN, IHK_MC_AP_NOWAIT | ap_flag); + LARGE_PAGE_P2ALIGN, IHK_MC_AP_NOWAIT | ap_flag, start); if (!stack) { kprintf("%s: error: couldn't allocate initial stack\n", @@ -2300,7 +2300,7 @@ unsigned long extend_process_region(struct process_vm *vm, p = ihk_mc_alloc_aligned_pages_user( (new_end_allocated - end_allocated) >> PAGE_SHIFT, align_p2align, IHK_MC_AP_NOWAIT | - (!(vm->proc->mpol_flags & MPOL_NO_HEAP) ? IHK_MC_AP_USER : 0)); + (!(vm->proc->mpol_flags & MPOL_NO_HEAP) ? IHK_MC_AP_USER : 0), end_allocated); if (!p) { return end_allocated; @@ -2891,7 +2891,7 @@ void sched_init(void) ihk_mc_init_context(&idle_thread->ctx, NULL, idle); ihk_mc_spinlock_init(&idle_thread->vm->memory_range_lock); idle_thread->vm->vm_range_tree = RB_ROOT; - INIT_LIST_HEAD(&idle_thread->vm->vm_range_numa_policy_list); + idle_thread->vm->vm_range_numa_policy_tree = RB_ROOT; idle_thread->proc->pid = 0; idle_thread->tid = ihk_mc_get_processor_id(); diff --git a/kernel/shmobj.c b/kernel/shmobj.c index ff1595b3..473aaadb 100644 --- a/kernel/shmobj.c +++ b/kernel/shmobj.c @@ -374,7 +374,7 @@ static void shmobj_ref(struct memobj *memobj) } static int shmobj_get_page(struct memobj *memobj, off_t off, int p2align, - uintptr_t *physp, unsigned long *pflag) + uintptr_t *physp, unsigned long *pflag, uintptr_t virt_addr) { struct shmobj *obj = to_shmobj(memobj); int error; @@ -415,7 +415,7 @@ static int shmobj_get_page(struct memobj *memobj, off_t off, int p2align, if (!page) { npages = 1 << p2align; virt = ihk_mc_alloc_aligned_pages_user(npages, p2align, - IHK_MC_AP_NOWAIT); + IHK_MC_AP_NOWAIT, virt_addr); if (!virt) { error = -ENOMEM; ekprintf("shmobj_get_page(%p,%#lx,%d,%p):" diff --git a/kernel/syscall.c b/kernel/syscall.c index 51ec6cbe..33030376 100644 --- a/kernel/syscall.c +++ b/kernel/syscall.c @@ -1473,7 +1473,7 @@ do_mmap(const intptr_t addr0, const size_t len0, const int prot, maxprot = PROT_READ | PROT_WRITE | PROT_EXEC; if (!(flags & MAP_ANONYMOUS)) { off = off0; - error = fileobj_create(fd, &memobj, &maxprot); + error = fileobj_create(fd, &memobj, &maxprot, addr0); #ifdef ATTACHED_MIC /* * XXX: refuse device mapping in attached-mic now: @@ -1536,7 +1536,7 @@ do_mmap(const intptr_t addr0, const size_t len0, const int prot, } p = ihk_mc_alloc_aligned_pages_user(npages, p2align, - IHK_MC_AP_NOWAIT | ap_flag); + IHK_MC_AP_NOWAIT | ap_flag, addr0); if (p == NULL) { dkprintf("%s: warning: failed to allocate %d contiguous pages " " (bytes: %lu, pgshift: %d), enabling demand paging\n", @@ -3771,6 +3771,57 @@ perf_mmap(struct mckfd *sfd, ihk_mc_user_context_t *ctx) return rc; } +struct vm_range_numa_policy *vm_range_policy_search(struct process_vm *vm, uintptr_t addr) +{ + struct rb_root *root = &vm->vm_range_numa_policy_tree; + struct rb_node *node = root->rb_node; + struct vm_range_numa_policy *numa_policy = NULL; + + while (node) { + numa_policy = rb_entry(node, struct vm_range_numa_policy, policy_rb_node); + if (addr < numa_policy->start) { + node = node->rb_left; + } else if (addr >= numa_policy->end) { + node = node->rb_right; + } else { + return numa_policy; + } + } + + return NULL; +} + +static int vm_policy_insert(struct process_vm *vm, struct vm_range_numa_policy *newrange) +{ + struct rb_root *root = &vm->vm_range_numa_policy_tree; + struct rb_node **new = &(root->rb_node), *parent = NULL; + struct vm_range_numa_policy *range; + + while (*new) { + range = rb_entry(*new, struct vm_range_numa_policy, policy_rb_node); + parent = *new; + if (newrange->end <= range->start) { + new = &((*new)->rb_left); + } else if (newrange->start >= range->end) { + new = &((*new)->rb_right); + } else { + ekprintf("vm_range_insert(%p,%lx-%lx (nodemask)%lx (policy)%d): overlap %lx-%lx (nodemask)%lx (policy)%d\n", + vm, newrange->start, newrange->end, newrange->numa_mask, newrange->numa_mem_policy, + range->start, range->end, range->numa_mask, range->numa_mem_policy); + return -EFAULT; + } + } + + dkprintf("vm_range_insert: %p,%p: %lx-%lx (nodemask)%lx (policy)%d\n", + vm, newrange, newrange->start, newrange->end, newrange->numa_mask, newrange->numa_mem_policy); + + rb_link_node(&newrange->policy_rb_node, parent, new); + rb_insert_color(&newrange->policy_rb_node, root); + + return 0; +} + + struct mc_perf_event* mc_perf_event_alloc(struct perf_event_attr *attr) { @@ -8063,8 +8114,7 @@ SYSCALL_DECLARE(mbind) int error = 0; int bit; struct vm_range *range; - struct vm_range_numa_policy *range_policy, *range_policy_iter; - struct vm_range_numa_policy *range_policy_next = NULL; + struct vm_range_numa_policy *range_policy, *range_policy_iter = NULL; DECLARE_BITMAP(numa_mask, PROCESS_NUMA_MASK_BITS); dkprintf("%s: addr: 0x%lx, len: %lu, mode: 0x%x, " @@ -8275,17 +8325,12 @@ SYSCALL_DECLARE(mbind) case MPOL_INTERLEAVE: case MPOL_PREFERRED: /* Adjust any overlapping range settings and add new one */ - range_policy_next = NULL; - list_for_each_entry(range_policy_iter, - &vm->vm_range_numa_policy_list, list) { + range_policy_iter = vm_range_policy_search(vm, addr); + if (range_policy_iter) { int adjusted = 0; unsigned long orig_end = range_policy_iter->end; - if (range_policy_iter->end < addr) - continue; - - /* Special case of entirely overlapping */ - if (range_policy_iter->start == addr && + if (range_policy_iter->start == addr && range_policy_iter->end == addr + len) { range_policy = range_policy_iter; goto mbind_update_only; @@ -8302,7 +8347,7 @@ SYSCALL_DECLARE(mbind) if (orig_end > addr + len) { if (adjusted) { /* Add a new entry after */ - range_policy = kmalloc(sizeof(*range_policy), + range_policy = kmalloc(sizeof(struct vm_range_numa_policy), IHK_MC_AP_NOWAIT); if (!range_policy) { dkprintf("%s: error allocating range_policy\n", @@ -8311,31 +8356,24 @@ SYSCALL_DECLARE(mbind) goto unlock_out; } - memcpy(range_policy, range_policy_iter, - sizeof(*range_policy)); + RB_CLEAR_NODE(&range_policy->policy_rb_node); range_policy->start = addr + len; range_policy->end = orig_end; - list_add(&range_policy->list, - &range_policy_iter->list); - range_policy_next = range_policy; - break; + + error = vm_policy_insert(vm, range_policy); + if (error) { + kprintf("%s: ERROR: could not insert range: %d\n",__FUNCTION__, error); + return error; + } } else { range_policy_iter->start = addr + len; - range_policy_next = range_policy_iter; - break; } } - - /* Next one in ascending address order? */ - if (range_policy_iter->start >= addr + len) { - range_policy_next = range_policy_iter; - break; - } } /* Add a new entry */ - range_policy = kmalloc(sizeof(*range_policy), + range_policy = kmalloc(sizeof(struct vm_range_numa_policy), IHK_MC_AP_NOWAIT); if (!range_policy) { dkprintf("%s: error allocating range_policy\n", @@ -8344,17 +8382,14 @@ SYSCALL_DECLARE(mbind) goto unlock_out; } - memset(range_policy, 0, sizeof(*range_policy)); + RB_CLEAR_NODE(&range_policy->policy_rb_node); range_policy->start = addr; range_policy->end = addr + len; - if (range_policy_next) { - list_add_tail(&range_policy->list, - &range_policy_next->list); - } - else { - list_add_tail(&range_policy->list, - &vm->vm_range_numa_policy_list); + error = vm_policy_insert(vm, range_policy); + if (error) { + kprintf("%s: ERROR: could not insert range: %d\n",__FUNCTION__, error); + return error; } mbind_update_only: @@ -8395,8 +8430,6 @@ SYSCALL_DECLARE(set_mempolicy) struct process_vm *vm = cpu_local_var(current)->vm; int error = 0; int bit, valid_mask; - struct vm_range_numa_policy *range_policy_iter; - struct vm_range_numa_policy *range_policy_next = NULL; DECLARE_BITMAP(numa_mask, PROCESS_NUMA_MASK_BITS); memset(numa_mask, 0, sizeof(numa_mask)); @@ -8417,6 +8450,8 @@ SYSCALL_DECLARE(set_mempolicy) } } + mode &= ~MPOL_MODE_FLAGS; + switch (mode) { case MPOL_DEFAULT: if (nodemask && nodemask_bits) { @@ -8440,6 +8475,13 @@ SYSCALL_DECLARE(set_mempolicy) set_bit(bit, vm->numa_mask); } +#if 0 + /* In man, "MPOL_DEFAULT mode deletes a process memory policy + other than the default and interprets that the memory policy" + falls back to the system default policy ", but not to delete + the NUMA memory policy. + There was no processing of Linux's same name command. */ + /* Delete all range settings */ ihk_mc_spinlock_lock_noirq(&vm->memory_range_lock); list_for_each_entry_safe(range_policy_iter, range_policy_next, @@ -8448,6 +8490,7 @@ SYSCALL_DECLARE(set_mempolicy) kfree(range_policy_iter); } ihk_mc_spinlock_unlock_noirq(&vm->memory_range_lock); +#endif vm->numa_mem_policy = mode; error = 0; @@ -8595,7 +8638,6 @@ SYSCALL_DECLARE(get_mempolicy) /* Address range specific? */ if (flags & MPOL_F_ADDR) { - struct vm_range_numa_policy *range_policy_iter; struct vm_range *range; ihk_mc_spinlock_lock_noirq(&vm->memory_range_lock); @@ -8607,16 +8649,8 @@ SYSCALL_DECLARE(get_mempolicy) goto out; } - list_for_each_entry(range_policy_iter, - &vm->vm_range_numa_policy_list, list) { - if (range_policy_iter->start > addr || - range_policy_iter->end <= addr) { - continue; - } + range_policy = vm_range_policy_search(vm, addr); - range_policy = range_policy_iter; - break; - } ihk_mc_spinlock_unlock_noirq(&vm->memory_range_lock); } diff --git a/kernel/zeroobj.c b/kernel/zeroobj.c index cf49c14d..1b0f78bb 100644 --- a/kernel/zeroobj.c +++ b/kernel/zeroobj.c @@ -169,7 +169,7 @@ out: } static int zeroobj_get_page(struct memobj *memobj, off_t off, int p2align, - uintptr_t *physp, unsigned long *pflag) + uintptr_t *physp, unsigned long *pflag, uintptr_t virt_addr) { int error; struct zeroobj *obj = to_zeroobj(memobj); diff --git a/lib/include/ihk/mm.h b/lib/include/ihk/mm.h index 5f06fc84..3053de49 100644 --- a/lib/include/ihk/mm.h +++ b/lib/include/ihk/mm.h @@ -90,7 +90,7 @@ void ihk_mc_reserve_arch_pages(struct ihk_page_allocator_desc *pa_allocator, unsigned long, unsigned long, int)); struct ihk_mc_pa_ops { - void *(*alloc_page)(int, int, ihk_mc_ap_flag, int node, int is_user); + void *(*alloc_page)(int, int, ihk_mc_ap_flag, int node, int is_user, uintptr_t virt_addr); void (*free_page)(void *, int, int is_user); void *(*alloc)(int, ihk_mc_ap_flag); @@ -115,33 +115,33 @@ int ihk_mc_free_micpa(unsigned long mic_pa); void ihk_mc_clean_micpa(void); void *_ihk_mc_alloc_aligned_pages_node(int npages, int p2align, - ihk_mc_ap_flag flag, int node, int is_user, char *file, int line); + ihk_mc_ap_flag flag, int node, int is_user, uintptr_t virt_addr, char *file, int line); #define ihk_mc_alloc_aligned_pages_node(npages, p2align, flag, node) ({\ -void *r = _ihk_mc_alloc_aligned_pages_node(npages, p2align, flag, node, IHK_MC_PG_KERNEL, __FILE__, __LINE__);\ +void *r = _ihk_mc_alloc_aligned_pages_node(npages, p2align, flag, node, IHK_MC_PG_KERNEL, -1, __FILE__, __LINE__);\ r;\ }) -#define ihk_mc_alloc_aligned_pages_node_user(npages, p2align, flag, node) ({\ -void *r = _ihk_mc_alloc_aligned_pages_node(npages, p2align, flag, node, IHK_MC_PG_USER, __FILE__, __LINE__);\ +#define ihk_mc_alloc_aligned_pages_node_user(npages, p2align, flag, node, virt_addr) ({\ +void *r = _ihk_mc_alloc_aligned_pages_node(npages, p2align, flag, node, IHK_MC_PG_USER, virt_addr, __FILE__, __LINE__);\ r;\ }) #define ihk_mc_alloc_aligned_pages(npages, p2align, flag) ({\ -void *r = _ihk_mc_alloc_aligned_pages_node(npages, p2align, flag, -1, IHK_MC_PG_KERNEL, __FILE__, __LINE__);\ +void *r = _ihk_mc_alloc_aligned_pages_node(npages, p2align, flag, -1, IHK_MC_PG_KERNEL, -1, __FILE__, __LINE__);\ r;\ }) -#define ihk_mc_alloc_aligned_pages_user(npages, p2align, flag) ({\ -void *r = _ihk_mc_alloc_aligned_pages_node(npages, p2align, flag, -1, IHK_MC_PG_USER, __FILE__, __LINE__);\ +#define ihk_mc_alloc_aligned_pages_user(npages, p2align, flag, virt_addr) ({\ +void *r = _ihk_mc_alloc_aligned_pages_node(npages, p2align, flag, -1, IHK_MC_PG_USER, virt_addr, __FILE__, __LINE__);\ r;\ }) #define ihk_mc_alloc_pages(npages, flag) ({\ -void *r = _ihk_mc_alloc_aligned_pages_node(npages, PAGE_P2ALIGN, flag, -1, IHK_MC_PG_KERNEL, __FILE__, __LINE__);\ +void *r = _ihk_mc_alloc_aligned_pages_node(npages, PAGE_P2ALIGN, flag, -1, IHK_MC_PG_KERNEL, -1, __FILE__, __LINE__);\ r;\ }) -#define ihk_mc_alloc_pages_user(npages, flag) ({\ -void *r = _ihk_mc_alloc_aligned_pages_node(npages, PAGE_P2ALIGN, flag, -1, IHK_MC_PG_USER, __FILE__, __LINE__);\ +#define ihk_mc_alloc_pages_user(npages, flag, virt_addr) ({\ +void *r = _ihk_mc_alloc_aligned_pages_node(npages, PAGE_P2ALIGN, flag, -1, IHK_MC_PG_USER, virt_addr, __FILE__, __LINE__);\ r;\ }) diff --git a/test/mbind/README b/test/mbind/README new file mode 100644 index 00000000..72eb38ca --- /dev/null +++ b/test/mbind/README @@ -0,0 +1,19 @@ +=================== +Advance preparation +=================== +1)Implement patch of test_trace_mem.patch +cd mckernel +patch -p0 < test_trace_mem.patch +make +make install + + +2)Compile command execution processing +cd mckernel/test/mbind/mcexec_test_proc/ +make + +========== +How to run +========== +./go_mbind_test.sh + diff --git a/test/mbind/chk_mbind_result.sh b/test/mbind/chk_mbind_result.sh new file mode 100755 index 00000000..fbfaf683 --- /dev/null +++ b/test/mbind/chk_mbind_result.sh @@ -0,0 +1,58 @@ +#!/bin/sh + +DEFAULT_POLICY_KIND="" +#SHARED_POLICY_KIND="" +NUMA_NODE_POLICY_KIND="" + +FILE_NAME=$1 +CHK_LOG_FILE="./result/${FILE_NAME}.log" + +source "./testcases/${FILE_NAME}.txt" +CHK_POLICY_KIND=${POLICY_KIND} + +SET_MEM_POLICY=`grep "OK:set_mempolicy" $CHK_LOG_FILE | grep -o '(MPOL.*)'` +SET_POLICY_NUM=`grep -c1 "OK:mbind" $CHK_LOG_FILE` + +for exec_num in `seq 0 $((SET_POLICY_NUM - 1))` +do + + if [ $exec_num -lt 10 ]; then + NUMA_NODE_ADDR=`grep "OK:mbind" $CHK_LOG_FILE | grep -e "0$exec_num]" | grep -o '(0x.*000)'` + NUMA_NODE_POLICY=`grep "OK:mbind" $CHK_LOG_FILE | grep -e "0$exec_num]" | grep -o '(MPOL.*)'` + else + NUMA_NODE_ADDR=`grep "OK:mbind" $CHK_LOG_FILE | grep -e "$exec_num]" | grep -o '(0x.*000)'` + NUMA_NODE_POLICY=`grep "OK:mbind" $CHK_LOG_FILE | grep -e "$exec_num]" | grep -o '(MPOL.*)'` + fi + + if [ "$CHK_POLICY_KIND" = "$DEFAULT_POLICY_KIND" ]; then + SET_MEM_POLICY_NUM=`grep -v $NUMA_NODE_ADDR $CHK_LOG_FILE | grep -e "$CHK_POLICY_KIND" | grep -ce "$SET_MEM_POLICY"` + if [ $SET_MEM_POLICY_NUM -gt 0 ]; then + echo "OK:" $exec_num $CHK_POLICY_KIND" - not address" $NUMA_NODE_ADDR "test policy" $SET_MEM_POLICY "allocate num:" $SET_MEM_POLICY_NUM + exit 0 + else + echo "NG:" $exec_num $CHK_POLICY_KIND" - not address" $NUMA_NODE_ADDR "test policy" $SET_MEM_POLICY "allocate num:" $SET_MEM_POLICY_NUM + exit 1 + fi + fi + + ALLOCATE_POLICY=`grep "mckernel_allocate_aligned_pages_node" $CHK_LOG_FILE | grep -e $NUMA_NODE_ADDR | grep -e "$CHK_POLICY_KIND" | grep -o '(MPOL.*)'` + + if [ "$CHK_POLICY_KIND" = "$NUMA_NODE_POLICY_KIND" ]; then + if [ $NUMA_NODE_POLICY != $ALLOCATE_POLICY ]; then + echo "NG:" $exec_num $CHK_POLICY_KIND" - address" $NUMA_NODE_ADDR "test policy" $NUMA_NODE_POLICY "allocate policy" $ALLOCATE_POLICY + exit 1 + else + echo "OK:" $exec_num $CHK_POLICY_KIND" - address" $NUMA_NODE_ADDR "test policy" $NUMA_NODE_POLICY "allocate policy" $ALLOCATE_POLICY + fi + else + if [ $SET_MEM_POLICY != $ALLOCATE_POLICY ]; then + echo "NG:" $exec_num $CHK_POLICY_KIND" - address" $NUMA_NODE_ADDR "test policy" $SET_MEM_POLICY "allocate policy" $ALLOCATE_POLICY + exit 1 + else + echo "OK:" $exec_num $CHK_POLICY_KIND" - address" $NUMA_NODE_ADDR "test policy" $SET_MEM_POLICY "allocate policy" $ALLOCATE_POLICY + fi + fi +done + +exit 0 + diff --git a/test/mbind/config b/test/mbind/config new file mode 100755 index 00000000..16ef4db3 --- /dev/null +++ b/test/mbind/config @@ -0,0 +1,3 @@ +MCMOD_DIR=$HOME/ppos + +export MCMOD_DIR diff --git a/test/mbind/go_mbind_test.sh b/test/mbind/go_mbind_test.sh new file mode 100755 index 00000000..85079fff --- /dev/null +++ b/test/mbind/go_mbind_test.sh @@ -0,0 +1,26 @@ +#!/bin/sh +START_NG_TEST_NO=0085 + +for test_case in `ls -1 ./testcases/*.txt` +do + case_name=`basename ${test_case} .txt` + + logfile="./result/${case_name}.log" + ./mbind_test.sh ${test_case} &> ${logfile} + + if [ $? -eq 0 ]; then + ./chk_mbind_result.sh ${case_name} + if [ $? -eq 0 ]; then + echo "[OK] ${case_name} is done." + else + echo "[NG] failed to test ${case_name}. Please check ${logfile}" + fi + else + test_number=`basename ${test_case} _mbind.txt` + if [ $test_number -ge $START_NG_TEST_NO ]; then + echo "[OK] ${case_name} is done(NG test case)." + else + echo "[NG] failed to test ${case_name}. Please check ${logfile}" + fi + fi +done diff --git a/test/mbind/mbind_test.sh b/test/mbind/mbind_test.sh new file mode 100755 index 00000000..c015890c --- /dev/null +++ b/test/mbind/mbind_test.sh @@ -0,0 +1,47 @@ +#!/bin/sh + +if [ $# -lt 1 ]; then + echo "Error: too few arguments." + echo "usage: `basename $0` " +fi + +# read config +source ./config + +# read testcase param +source $1 + +# mcexec processのkill +./utils/kill_mcexec.sh &> /dev/null + +# stop mckernel +sudo ${MCMOD_DIR}/sbin/mcstop+release.sh + +sleep 1 + +# boot mckernel +echo "${MCMOD_DIR}/sbin/mcreboot.sh ${MCRBT_OPT%,}" +sudo ${MCMOD_DIR}/sbin/mcreboot.sh ${MCRBT_OPT%,} + +sleep 1 + +if [ ! -e "/dev/mcos0" ]; then + echo "Error: failed to mcreboot" + exit 1 +fi + +# exec mckernel test program +echo "${MCMOD_DIR}/bin/mcexec ${USR_PROC}" +${MCMOD_DIR}/bin/mcexec ${USR_PROC} + +#if [ $? -eq 0 ]; then +if [ $? == 0 ]; then + sleep 1 + + echo "${MCMOD_DIR}/sbin/ihkosctl ${OS_IDX} kmsg" + sudo ${MCMOD_DIR}/sbin/ihkosctl ${OS_IDX} kmsg + exit 0 +else + echo "Error: faild to mcexec" + exit 1 +fi diff --git a/test/mbind/mcexec_test_proc/Makefile b/test/mbind/mcexec_test_proc/Makefile new file mode 100644 index 00000000..a01dcbc6 --- /dev/null +++ b/test/mbind/mcexec_test_proc/Makefile @@ -0,0 +1,7 @@ +OBJS = exec_setmempolicy_mbind exec_setmempolicy_mbind_shared +LDFLAGS = -lnuma + +all: $(OBJS) + +clean: + rm $(OBJS) diff --git a/test/mbind/mcexec_test_proc/exec_setmempolicy_mbind.c b/test/mbind/mcexec_test_proc/exec_setmempolicy_mbind.c new file mode 100644 index 00000000..2ba4cea9 --- /dev/null +++ b/test/mbind/mcexec_test_proc/exec_setmempolicy_mbind.c @@ -0,0 +1,208 @@ +#include +#include +#include +#include +#include + +#define PAGE_SIZE (4096) + +typedef struct func_setmem_para { + int set_mode; + int dummy; + unsigned long set_nodemask; + unsigned long set_maxnode; +} set_mem_para; + +typedef struct func_mbind_para { + int set_mode; + int loop_cnt; + unsigned long set_nodemask; + unsigned long set_maxnode; + unsigned flags; +} mbind_para; + + +typedef struct func_para { + set_mem_para para1; + mbind_para para2; +} main_para; + + + +char *mempolicy [] = { + "MPOL_DEFAULT", + "MPOL_PREFERRED", + "MPOL_BIND", + "MPOL_INTERLEAVE" +}; + +int func_set_mempolicy(set_mem_para* inpara) +{ + int rst = -1; + int set_mode = inpara->set_mode; + unsigned long set_nodemask = inpara->set_nodemask; + unsigned long set_maxnode = inpara->set_maxnode; + int mode = set_mode & 0x00000003; + + rst = set_mempolicy(set_mode, &set_nodemask, set_maxnode); + + printf("-----\n"); + if (rst < 0) { + printf("NG:set_mempolicy - mode:(%s) nodemask:0x%x maxnode:%d rst:%d\n" + ,mempolicy[mode] ,set_nodemask ,set_maxnode, rst); + //assert(0 && "set_mempolicy() failed"); + } else { + printf("OK:set_mempolicy - mode:(%s) nodemask:0x%x maxnode:%d\n" + ,mempolicy[mode] ,set_nodemask ,set_maxnode); + } + printf("-----\n"); + + return rst; +} + +int func_mbind(mbind_para* inpara) +{ + int rst = -1; + unsigned char *addr = NULL; + int get_mode = 0; + int i = 0; + unsigned long mem_len = PAGE_SIZE; + + int set_mode = inpara->set_mode; + unsigned long set_nodemask = inpara->set_nodemask; + unsigned long set_maxnode = inpara->set_maxnode; + unsigned flags = inpara->flags; + int loop_cnt = inpara->loop_cnt; + int mode = set_mode & 0x00000003; + + for (i = 0; i < loop_cnt; i++) { + + addr = mmap(0, mem_len, (PROT_READ | PROT_WRITE), + (MAP_ANONYMOUS | MAP_PRIVATE), 0, 0); + if (addr == (void *) -1) { + printf("[%02d] NG:mmap - len:%d prot:0x%x flags:0x%x\n" + ,i ,mem_len ,(PROT_READ | PROT_WRITE) ,(MAP_ANONYMOUS | MAP_PRIVATE)); + //assert(0 && "mmap() failed"); + return -1; + } else { +// printf("[%02d] OK:mmap - addr:(0x%016lx) len:%d prot:0x%x flags:0x%x\n" +// ,i ,addr ,mem_len ,(PROT_READ | PROT_WRITE) ,(MAP_ANONYMOUS | MAP_PRIVATE)); + } + + if ((inpara->set_mode & 0x000000ff) == 0xff) { + switch ((i & 0x3)) { + case MPOL_PREFERRED: + set_mode = ((set_mode & 0xffffff00) | MPOL_PREFERRED); + set_nodemask = inpara->set_nodemask; + flags = 0; + mode = MPOL_PREFERRED; + break; + + case MPOL_BIND: + set_mode = ((set_mode & 0xffffff00) | MPOL_BIND); + set_nodemask = inpara->set_nodemask; + flags = 0; + mode = MPOL_BIND; + break; + + case MPOL_INTERLEAVE: + set_mode = ((set_mode & 0xffffff00) | MPOL_INTERLEAVE); + set_nodemask = inpara->set_nodemask; + flags = 0; + mode = MPOL_INTERLEAVE; + break; + + case MPOL_DEFAULT: + default: + set_mode = ((set_mode & 0xffffff00) | MPOL_DEFAULT); + set_nodemask = 0; + flags = MPOL_MF_STRICT; + mode = MPOL_DEFAULT; + break; + } + } + + rst = mbind(addr, mem_len, set_mode, &set_nodemask, set_maxnode, flags); + if (rst < 0) { + printf("[%02d] NG:mbind - addr:(0x%016lx) len:%d mode:(%s) nodemask:0x%x maxnode:%d flags:%d rst:%d\n" + ,i ,addr ,mem_len ,mempolicy[mode] ,set_nodemask ,set_maxnode ,flags ,rst); + //assert(0 && "mbind() failed"); + return -1; + } else { + printf("[%02d] OK:mbind - addr:(0x%016lx) len:%d mode:(%s) nodemask:0x%x maxnode:%d flags:%d\n" + ,i ,addr ,mem_len ,mempolicy[mode] ,set_nodemask ,set_maxnode ,flags); + } + + rst = get_mempolicy(&get_mode, NULL, 0, addr, MPOL_F_ADDR); + if(rst < 0) { + printf("[%02d] NG:get_mempolicy - addr:(0x%016lx) rst:%d\n" + ,i ,addr , rst); + //assert(0 && "get_mempolicy failed"); + return -1; + } else { + printf("[%02d] OK:get_mempolicy - addr:(0x%016lx) mode:(%s)\n" + ,i ,addr ,mempolicy[get_mode]); + } + + rst = munmap(addr, mem_len); + if (rst < 0) { + printf("[%02d] NG:munmap - addr:(0x%016lx) len:%d\n" + ,i ,addr ,mem_len); + } else { +// printf("[%02d] OK:munmap - addr:(0x%016lx) len:%d\n" +// ,i ,addr ,mem_len); + } + + addr = mmap(addr, mem_len, (PROT_READ | PROT_WRITE), + (MAP_FIXED | MAP_ANONYMOUS | MAP_PRIVATE), 0, 0); + if (addr == (void *) -1) { + printf("[%02d] NG:mmap - len:%d prot:0x%x flags:0x%x\n" + ,i ,mem_len ,(PROT_READ | PROT_WRITE) ,(MAP_FIXED | MAP_ANONYMOUS | MAP_PRIVATE)); + //assert(0 && "mmap() failed"); + return -1; + } else { +// printf("[%02d] OK:mmap - addr:(0x%016lx) len:%d prot:0x%x flags:0x%x\n" +// ,i ,addr ,mem_len ,(PROT_READ | PROT_WRITE) ,(MAP_FIXED | MAP_ANONYMOUS | MAP_PRIVATE)); + } + printf("-----\n"); + + } + + return 0; +} + +int main(int argc, char *argv[]) +{ + main_para inpara; + int rst = -1; + + if (argc == 9 ) { + + inpara.para1.set_mode = strtol(argv[1], NULL, 16); + inpara.para1.set_nodemask = strtoul(argv[2], NULL, 16); + inpara.para1.set_maxnode = strtol(argv[3], NULL, 10); + rst = func_set_mempolicy(&inpara.para1); + if (rst == 0) { + inpara.para2.set_mode = strtol(argv[4], NULL, 16); + inpara.para2.set_nodemask = strtoul(argv[5], NULL, 16); + inpara.para2.set_maxnode = strtoul(argv[6], NULL, 10); + inpara.para2.flags = strtoul(argv[7], NULL, 16); + inpara.para2.loop_cnt = strtol(argv[8], NULL, 10); + rst = func_mbind(&inpara.para2); + } + } else { + printf("NG: Invalid number of parameters(%d)\n",(argc-1)); + printf(" parameter 1 : set_mempolicy(mode)\n"); + printf(" parameter 2 : set_mempolicy(nodemask)\n"); + printf(" parameter 3 : set_mempolicy(maxnode)\n"); + printf(" parameter 4 : mbind(mode) 0xff - all mode\n"); + printf(" parameter 5 : mbind(nodemask)\n"); + printf(" parameter 6 : mbind(maxnode)\n"); + printf(" parameter 7 : mbind(flags)\n"); + printf(" parameter 8 : Number of mbind executed\n"); + printf(" example) ./exec_setmempolicy_mbind 0x1 0x1 2 0x2 0x1 2 0x0 1\n"); + } + + return rst; +} + diff --git a/test/mbind/mcexec_test_proc/exec_setmempolicy_mbind_shared.c b/test/mbind/mcexec_test_proc/exec_setmempolicy_mbind_shared.c new file mode 100644 index 00000000..eeb537e0 --- /dev/null +++ b/test/mbind/mcexec_test_proc/exec_setmempolicy_mbind_shared.c @@ -0,0 +1,208 @@ +#include +#include +#include +#include +#include + +#define PAGE_SIZE (4096) + +typedef struct func_setmem_para { + int set_mode; + int dummy; + unsigned long set_nodemask; + unsigned long set_maxnode; +} set_mem_para; + +typedef struct func_mbind_para { + int set_mode; + int loop_cnt; + unsigned long set_nodemask; + unsigned long set_maxnode; + unsigned flags; +} mbind_para; + + +typedef struct func_para { + set_mem_para para1; + mbind_para para2; +} main_para; + + + +char *mempolicy [] = { + "MPOL_DEFAULT", + "MPOL_PREFERRED", + "MPOL_BIND", + "MPOL_INTERLEAVE" +}; + +int func_set_mempolicy(set_mem_para* inpara) +{ + int rst = -1; + int set_mode = inpara->set_mode; + unsigned long set_nodemask = inpara->set_nodemask; + unsigned long set_maxnode = inpara->set_maxnode; + int mode = set_mode & 0x00000003; + + rst = set_mempolicy(set_mode, &set_nodemask, set_maxnode); + + printf("-----\n"); + if (rst < 0) { + printf("NG:set_mempolicy - mode:(%s) nodemask:0x%x maxnode:%d rst:%d\n" + ,mempolicy[mode] ,set_nodemask ,set_maxnode, rst); + //assert(0 && "set_mempolicy() failed"); + } else { + printf("OK:set_mempolicy - mode:(%s) nodemask:0x%x maxnode:%d\n" + ,mempolicy[mode] ,set_nodemask ,set_maxnode); + } + printf("-----\n"); + + return rst; +} + +int func_mbind(mbind_para* inpara) +{ + int rst = -1; + unsigned char *addr = NULL; + int get_mode = 0; + int i = 0; + unsigned long mem_len = PAGE_SIZE; + + int set_mode = inpara->set_mode; + unsigned long set_nodemask = inpara->set_nodemask; + unsigned long set_maxnode = inpara->set_maxnode; + unsigned flags = inpara->flags; + int loop_cnt = inpara->loop_cnt; + int mode = set_mode & 0x00000003; + + for (i = 0; i < loop_cnt; i++) { + + addr = mmap(0, mem_len, (PROT_READ | PROT_WRITE), + (MAP_ANONYMOUS | MAP_SHARED | MAP_POPULATE), 0, 0); + if (addr == (void *) -1) { + printf("[%02d] NG:mmap - len:%d prot:0x%x flags:0x%x\n" + ,i ,mem_len ,(PROT_READ | PROT_WRITE) ,(MAP_ANONYMOUS | MAP_SHARED | MAP_POPULATE)); + //assert(0 && "mmap() failed"); + return -1; + } else { +// printf("[%02d] OK:mmap - addr:(0x%016lx) len:%d prot:0x%x flags:0x%x\n" +// ,i ,addr ,mem_len ,(PROT_READ | PROT_WRITE) ,(MAP_ANONYMOUS | MAP_SHARED | MAP_POPULATE)); + } + + if ((inpara->set_mode & 0x000000ff) == 0xff) { + switch ((i & 0x3)) { + case MPOL_PREFERRED: + set_mode = ((set_mode & 0xffffff00) | MPOL_PREFERRED); + set_nodemask = inpara->set_nodemask; + flags = 0; + mode = MPOL_PREFERRED; + break; + + case MPOL_BIND: + set_mode = ((set_mode & 0xffffff00) | MPOL_BIND); + set_nodemask = inpara->set_nodemask; + flags = 0; + mode = MPOL_BIND; + break; + + case MPOL_INTERLEAVE: + set_mode = ((set_mode & 0xffffff00) | MPOL_INTERLEAVE); + set_nodemask = inpara->set_nodemask; + flags = 0; + mode = MPOL_INTERLEAVE; + break; + + case MPOL_DEFAULT: + default: + set_mode = ((set_mode & 0xffffff00) | MPOL_DEFAULT); + set_nodemask = 0; + flags = MPOL_MF_STRICT; + mode = MPOL_DEFAULT; + break; + } + } + + rst = mbind(addr, mem_len, set_mode, &set_nodemask, set_maxnode, flags); + if (rst < 0) { + printf("[%02d] NG:mbind - addr:(0x%016lx) len:%d mode:(%s) nodemask:0x%x maxnode:%d flags:%d rst:%d\n" + ,i ,addr ,mem_len ,mempolicy[mode] ,set_nodemask ,set_maxnode ,flags ,rst); + //assert(0 && "mbind() failed"); + return -1; + } else { + printf("[%02d] OK:mbind - addr:(0x%016lx) len:%d mode:(%s) nodemask:0x%x maxnode:%d flags:%d\n" + ,i ,addr ,mem_len ,mempolicy[mode] ,set_nodemask ,set_maxnode ,flags); + } + + rst = get_mempolicy(&get_mode, NULL, 0, addr, MPOL_F_ADDR); + if(rst < 0) { + printf("[%02d] NG:get_mempolicy - addr:(0x%016lx) rst:%d\n" + ,i ,addr , rst); + //assert(0 && "get_mempolicy failed"); + return -1; + } else { + printf("[%02d] OK:get_mempolicy - addr:(0x%016lx) mode:(%s)\n" + ,i ,addr ,mempolicy[get_mode]); + } + + rst = munmap(addr, mem_len); + if (rst < 0) { + printf("[%02d] NG:munmap - addr:(0x%016lx) len:%d\n" + ,i ,addr ,mem_len); + } else { +// printf("[%02d] OK:munmap - addr:(0x%016lx) len:%d\n" +// ,i ,addr ,mem_len); + } + + addr = mmap(addr, mem_len, (PROT_READ | PROT_WRITE), + (MAP_FIXED | MAP_ANONYMOUS | MAP_SHARED | MAP_POPULATE), 0, 0); + if (addr == (void *) -1) { + printf("[%02d] NG:mmap - len:%d prot:0x%x flags:0x%x\n" + ,i ,mem_len ,(PROT_READ | PROT_WRITE) ,(MAP_FIXED | MAP_ANONYMOUS | MAP_SHARED | MAP_POPULATE)); + //assert(0 && "mmap() failed"); + return -1; + } else { +// printf("[%02d] OK:mmap - addr:(0x%016lx) len:%d prot:0x%x flags:0x%x\n" +// ,i ,addr ,mem_len ,(PROT_READ | PROT_WRITE) ,(MAP_FIXED | MAP_ANONYMOUS | MAP_SHARED | MAP_POPULATE)); + } + printf("-----\n"); + + } + + return 0; +} + +int main(int argc, char *argv[]) +{ + main_para inpara; + int rst = -1; + + if (argc == 9 ) { + + inpara.para1.set_mode = strtol(argv[1], NULL, 16); + inpara.para1.set_nodemask = strtoul(argv[2], NULL, 16); + inpara.para1.set_maxnode = strtol(argv[3], NULL, 10); + rst = func_set_mempolicy(&inpara.para1); + if (rst == 0) { + inpara.para2.set_mode = strtol(argv[4], NULL, 16); + inpara.para2.set_nodemask = strtoul(argv[5], NULL, 16); + inpara.para2.set_maxnode = strtoul(argv[6], NULL, 10); + inpara.para2.flags = strtoul(argv[7], NULL, 16); + inpara.para2.loop_cnt = strtol(argv[8], NULL, 10); + rst = func_mbind(&inpara.para2); + } + } else { + printf("NG: Invalid number of parameters(%d)\n",(argc-1)); + printf(" parameter 1 : set_mempolicy(mode)\n"); + printf(" parameter 2 : set_mempolicy(nodemask)\n"); + printf(" parameter 3 : set_mempolicy(maxnode)\n"); + printf(" parameter 4 : mbind(mode) 0xff - all mode\n"); + printf(" parameter 5 : mbind(nodemask)\n"); + printf(" parameter 6 : mbind(maxnode)\n"); + printf(" parameter 7 : mbind(flags)\n"); + printf(" parameter 8 : Number of mbind executed\n"); + printf(" example) ./exec_setmempolicy_mbind 0x1 0x1 2 0x2 0x1 2 0x0 1\n"); + } + + return rst; +} + diff --git a/test/mbind/result/.gitignore b/test/mbind/result/.gitignore new file mode 100644 index 00000000..e69de29b diff --git a/test/mbind/test_trace_mem.patch b/test/mbind/test_trace_mem.patch new file mode 100644 index 00000000..40a5d83b --- /dev/null +++ b/test/mbind/test_trace_mem.patch @@ -0,0 +1,75 @@ +diff --git kernel/mem.c kernel/mem.c +index 62cb206..5bfb6d6 100644 +--- kernel/mem.c ++++ kernel/mem.c +@@ -542,6 +542,15 @@ static void reserve_pages(struct ihk_page_allocator_desc *pa_allocator, + ihk_pagealloc_reserve(pa_allocator, start, end); + } + ++#if 1 /* Trace for DEBUG */ ++char *mempolicy [] = { ++ "MPOL_DEFAULT", ++ "MPOL_PREFERRED", ++ "MPOL_BIND", ++ "MPOL_INTERLEAVE" ++}; ++#endif ++ + extern int cpu_local_var_initialized; + static void *mckernel_allocate_aligned_pages_node(int npages, int p2align, + ihk_mc_ap_flag flag, int pref_node, int is_user, uintptr_t virt_addr) +@@ -585,6 +594,23 @@ static void *mckernel_allocate_aligned_pages_node(int npages, int p2align, + } + } + ++#if 1 /* Trace for DEBUG */ ++ if (!((range_policy_iter) && (range_policy_iter->numa_mem_policy != MPOL_DEFAULT))) { ++ if ((range_policy_iter) && (range_policy_iter->numa_mem_policy == MPOL_DEFAULT)) { ++ if (chk_shm == 0) { ++ kprintf("%s[%d]: addr(0x%016lx) policy(%s) \n" ++ ,__FUNCTION__ ,__LINE__ ,virt_addr ,mempolicy[(range_policy_iter->numa_mem_policy & 0x3)]); ++ } ++ } else { ++ if ((cpu_local_var(current)->vm->numa_mem_policy == MPOL_DEFAULT) && (virt_addr != -1)) { ++ if (virt_addr) { ++ kprintf("%s[%d]: addr(0x%016lx) policy(%s) \n" ++ ,__FUNCTION__ ,__LINE__ ,virt_addr ,mempolicy[(cpu_local_var(current)->vm->numa_mem_policy & 0x3)]); ++ } ++ } ++ } ++ } ++#endif + + if ((!((range_policy_iter) && (range_policy_iter->numa_mem_policy != MPOL_DEFAULT))) && (chk_shm == 0)) + goto distance_based; +@@ -647,10 +673,30 @@ static void *mckernel_allocate_aligned_pages_node(int npages, int p2align, + chk_shm = 1; + } else { + numa_mem_policy = range_policy_iter->numa_mem_policy; ++ ++#if 1 /* Trace for DEBUG */ ++ kprintf("%s[%d]: addr(0x%016lx) policy(%s) \n" ++ ,__FUNCTION__ ,__LINE__ ,virt_addr ,mempolicy[(numa_mem_policy & 0x3)]); ++#endif ++ + } + } + } + ++#if 1 /* Trace for DEBUG */ ++ if (numa_mem_policy == -1) { ++ if (chk_shm == 1) { ++ kprintf("%s[%d]: addr(0x%016lx) policy(%s) \n" ++ ,__FUNCTION__ ,__LINE__ ,virt_addr ,mempolicy[(cpu_local_var(current)->vm->numa_mem_policy & 0x3)]); ++ } else { ++ if (virt_addr) { ++ kprintf("%s[%d]: addr(0x%016lx) policy(%s) \n" ++ ,__FUNCTION__ ,__LINE__ ,virt_addr ,mempolicy[(cpu_local_var(current)->vm->numa_mem_policy & 0x3)]); ++ } ++ } ++ } ++#endif ++ + if (numa_mem_policy == -1) + numa_mem_policy = cpu_local_var(current)->vm->numa_mem_policy; + diff --git a/test/mbind/testcases/0001_mbind.txt b/test/mbind/testcases/0001_mbind.txt new file mode 100644 index 00000000..0c7256fc --- /dev/null +++ b/test/mbind/testcases/0001_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 1`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 1 0x8000 0x0 1 1 1" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0002_mbind.txt b/test/mbind/testcases/0002_mbind.txt new file mode 100644 index 00000000..28c7b140 --- /dev/null +++ b/test/mbind/testcases/0002_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 1`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 1 0x8001 0x1 1 0 1" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0003_mbind.txt b/test/mbind/testcases/0003_mbind.txt new file mode 100644 index 00000000..dfcdab28 --- /dev/null +++ b/test/mbind/testcases/0003_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 1`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 1 0x8002 0x1 1 0 1" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0004_mbind.txt b/test/mbind/testcases/0004_mbind.txt new file mode 100644 index 00000000..0bf3c6c0 --- /dev/null +++ b/test/mbind/testcases/0004_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 1`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 1 0x8003 0x1 1 0 1" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0005_mbind.txt b/test/mbind/testcases/0005_mbind.txt new file mode 100644 index 00000000..26f23c60 --- /dev/null +++ b/test/mbind/testcases/0005_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 1`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 1 0x80ff 0x1 1 0 4" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0006_mbind.txt b/test/mbind/testcases/0006_mbind.txt new file mode 100644 index 00000000..20fb29fb --- /dev/null +++ b/test/mbind/testcases/0006_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 1`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 1 0x80ff 0x1 1 0 40" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0007_mbind.txt b/test/mbind/testcases/0007_mbind.txt new file mode 100644 index 00000000..124cee2f --- /dev/null +++ b/test/mbind/testcases/0007_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 1`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 1 0x8000 0x0 1 1 1" +OS_IDX=0 +#POLICY_KIND="" +POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0008_mbind.txt b/test/mbind/testcases/0008_mbind.txt new file mode 100644 index 00000000..16175a63 --- /dev/null +++ b/test/mbind/testcases/0008_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 1`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8001 0x1 1 0x8000 0x0 1 1 1" +OS_IDX=0 +#POLICY_KIND="" +POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0009_mbind.txt b/test/mbind/testcases/0009_mbind.txt new file mode 100644 index 00000000..7771c044 --- /dev/null +++ b/test/mbind/testcases/0009_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 1`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8002 0x1 1 0x8000 0x0 1 1 1" +OS_IDX=0 +#POLICY_KIND="" +POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0010_mbind.txt b/test/mbind/testcases/0010_mbind.txt new file mode 100644 index 00000000..553950c1 --- /dev/null +++ b/test/mbind/testcases/0010_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 1`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8003 0x1 1 0x8000 0x0 1 1 1" +OS_IDX=0 +#POLICY_KIND="" +POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0011_mbind.txt b/test/mbind/testcases/0011_mbind.txt new file mode 100644 index 00000000..dec1e1f1 --- /dev/null +++ b/test/mbind/testcases/0011_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 1`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind_shared 0x8000 0x0 1 0x8003 0x1 1 0 1" +OS_IDX=0 +#POLICY_KIND="" +#POLICY_KIND="" +POLICY_KIND="" diff --git a/test/mbind/testcases/0012_mbind.txt b/test/mbind/testcases/0012_mbind.txt new file mode 100644 index 00000000..7970a0e5 --- /dev/null +++ b/test/mbind/testcases/0012_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 1`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind_shared 0x8001 0x1 1 0x8002 0x1 1 0 1" +OS_IDX=0 +#POLICY_KIND="" +#POLICY_KIND="" +POLICY_KIND="" diff --git a/test/mbind/testcases/0013_mbind.txt b/test/mbind/testcases/0013_mbind.txt new file mode 100644 index 00000000..15759a0a --- /dev/null +++ b/test/mbind/testcases/0013_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 1`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind_shared 0x8002 0x1 1 0x8001 0x1 1 0 1" +OS_IDX=0 +#POLICY_KIND="" +#POLICY_KIND="" +POLICY_KIND="" diff --git a/test/mbind/testcases/0014_mbind.txt b/test/mbind/testcases/0014_mbind.txt new file mode 100644 index 00000000..53383ac0 --- /dev/null +++ b/test/mbind/testcases/0014_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 1`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind_shared 0x8003 0x1 1 0x8000 0x0 1 0 1" +OS_IDX=0 +#POLICY_KIND="" +#POLICY_KIND="" +POLICY_KIND="" diff --git a/test/mbind/testcases/0015_mbind.txt b/test/mbind/testcases/0015_mbind.txt new file mode 100644 index 00000000..121acfee --- /dev/null +++ b/test/mbind/testcases/0015_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 1`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 2 0x8000 0x0 2 1 1" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0016_mbind.txt b/test/mbind/testcases/0016_mbind.txt new file mode 100644 index 00000000..9476f033 --- /dev/null +++ b/test/mbind/testcases/0016_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 1`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 2 0x8001 0x3 2 0 1" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0017_mbind.txt b/test/mbind/testcases/0017_mbind.txt new file mode 100644 index 00000000..d9ac8762 --- /dev/null +++ b/test/mbind/testcases/0017_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 1`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 2 0x8002 0x3 2 0 1" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0018_mbind.txt b/test/mbind/testcases/0018_mbind.txt new file mode 100644 index 00000000..49aaf142 --- /dev/null +++ b/test/mbind/testcases/0018_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 1`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 2 0x8003 0x3 2 0 1" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0019_mbind.txt b/test/mbind/testcases/0019_mbind.txt new file mode 100644 index 00000000..c2ed8e3f --- /dev/null +++ b/test/mbind/testcases/0019_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 1`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 2 0x80ff 0x3 2 0 4" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0020_mbind.txt b/test/mbind/testcases/0020_mbind.txt new file mode 100644 index 00000000..13ec29ba --- /dev/null +++ b/test/mbind/testcases/0020_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 1`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 2 0x80ff 0x3 2 0 40" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0021_mbind.txt b/test/mbind/testcases/0021_mbind.txt new file mode 100644 index 00000000..510a43b9 --- /dev/null +++ b/test/mbind/testcases/0021_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 1`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 2 0x8000 0x0 2 1 1" +OS_IDX=0 +#POLICY_KIND="" +POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0022_mbind.txt b/test/mbind/testcases/0022_mbind.txt new file mode 100644 index 00000000..951ed2cb --- /dev/null +++ b/test/mbind/testcases/0022_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 1`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8001 0x3 2 0x8000 0x0 2 1 1" +OS_IDX=0 +#POLICY_KIND="" +POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0023_mbind.txt b/test/mbind/testcases/0023_mbind.txt new file mode 100644 index 00000000..a2c85848 --- /dev/null +++ b/test/mbind/testcases/0023_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 1`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8002 0x3 2 0x8000 0x0 2 1 1" +OS_IDX=0 +#POLICY_KIND="" +POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0024_mbind.txt b/test/mbind/testcases/0024_mbind.txt new file mode 100644 index 00000000..71e0cc80 --- /dev/null +++ b/test/mbind/testcases/0024_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 1`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8003 0x3 2 0x8000 0x0 2 1 1" +OS_IDX=0 +#POLICY_KIND="" +POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0025_mbind.txt b/test/mbind/testcases/0025_mbind.txt new file mode 100644 index 00000000..1fc4d56f --- /dev/null +++ b/test/mbind/testcases/0025_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 1`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind_shared 0x8000 0x0 2 0x8003 0x3 2 0 1" +OS_IDX=0 +#POLICY_KIND="" +#POLICY_KIND="" +POLICY_KIND="" diff --git a/test/mbind/testcases/0026_mbind.txt b/test/mbind/testcases/0026_mbind.txt new file mode 100644 index 00000000..1fd5190c --- /dev/null +++ b/test/mbind/testcases/0026_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 1`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind_shared 0x8001 0x3 2 0x8002 0x3 2 0 1" +OS_IDX=0 +#POLICY_KIND="" +#POLICY_KIND="" +POLICY_KIND="" diff --git a/test/mbind/testcases/0027_mbind.txt b/test/mbind/testcases/0027_mbind.txt new file mode 100644 index 00000000..2f3e7fe5 --- /dev/null +++ b/test/mbind/testcases/0027_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 1`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind_shared 0x8002 0x3 2 0x8001 0x3 2 0 1" +OS_IDX=0 +#POLICY_KIND="" +#POLICY_KIND="" +POLICY_KIND="" diff --git a/test/mbind/testcases/0028_mbind.txt b/test/mbind/testcases/0028_mbind.txt new file mode 100644 index 00000000..17a8cb51 --- /dev/null +++ b/test/mbind/testcases/0028_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 1`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind_shared 0x8003 0x3 2 0x8000 0x0 2 0 1" +OS_IDX=0 +#POLICY_KIND="" +#POLICY_KIND="" +POLICY_KIND="" diff --git a/test/mbind/testcases/0029_mbind.txt b/test/mbind/testcases/0029_mbind.txt new file mode 100644 index 00000000..01444384 --- /dev/null +++ b/test/mbind/testcases/0029_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 16`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 1 0x8000 0x0 1 1 1" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0030_mbind.txt b/test/mbind/testcases/0030_mbind.txt new file mode 100644 index 00000000..1bc50590 --- /dev/null +++ b/test/mbind/testcases/0030_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 16`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 1 0x8001 0x1 1 0 1" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0031_mbind.txt b/test/mbind/testcases/0031_mbind.txt new file mode 100644 index 00000000..cfbf7163 --- /dev/null +++ b/test/mbind/testcases/0031_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 16`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 1 0x8002 0x1 1 0 1" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0032_mbind.txt b/test/mbind/testcases/0032_mbind.txt new file mode 100644 index 00000000..8dbf6490 --- /dev/null +++ b/test/mbind/testcases/0032_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 16`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 1 0x8003 0x1 1 0 1" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0033_mbind.txt b/test/mbind/testcases/0033_mbind.txt new file mode 100644 index 00000000..1ff9d4d2 --- /dev/null +++ b/test/mbind/testcases/0033_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 16`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 1 0x80ff 0x1 1 0 4" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0034_mbind.txt b/test/mbind/testcases/0034_mbind.txt new file mode 100644 index 00000000..3f759efa --- /dev/null +++ b/test/mbind/testcases/0034_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 16`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 1 0x80ff 0x1 1 0 40" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0035_mbind.txt b/test/mbind/testcases/0035_mbind.txt new file mode 100644 index 00000000..a2231748 --- /dev/null +++ b/test/mbind/testcases/0035_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 16`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 1 0x8000 0x0 1 1 1" +OS_IDX=0 +#POLICY_KIND="" +POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0036_mbind.txt b/test/mbind/testcases/0036_mbind.txt new file mode 100644 index 00000000..a3c033c1 --- /dev/null +++ b/test/mbind/testcases/0036_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 16`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8001 0x1 1 0x8000 0x0 1 1 1" +OS_IDX=0 +#POLICY_KIND="" +POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0037_mbind.txt b/test/mbind/testcases/0037_mbind.txt new file mode 100644 index 00000000..3d3ae5d6 --- /dev/null +++ b/test/mbind/testcases/0037_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 16`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8002 0x1 1 0x8000 0x0 1 1 1" +OS_IDX=0 +#POLICY_KIND="" +POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0038_mbind.txt b/test/mbind/testcases/0038_mbind.txt new file mode 100644 index 00000000..878258ab --- /dev/null +++ b/test/mbind/testcases/0038_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 16`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8003 0x1 1 0x8000 0x0 1 1 1" +OS_IDX=0 +#POLICY_KIND="" +POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0039_mbind.txt b/test/mbind/testcases/0039_mbind.txt new file mode 100644 index 00000000..411cd2ff --- /dev/null +++ b/test/mbind/testcases/0039_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 16`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind_shared 0x8000 0x0 1 0x8003 0x1 1 0 1" +OS_IDX=0 +#POLICY_KIND="" +#POLICY_KIND="" +POLICY_KIND="" diff --git a/test/mbind/testcases/0040_mbind.txt b/test/mbind/testcases/0040_mbind.txt new file mode 100644 index 00000000..2663a4b9 --- /dev/null +++ b/test/mbind/testcases/0040_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 16`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind_shared 0x8001 0x1 1 0x8002 0x1 1 0 1" +OS_IDX=0 +#POLICY_KIND="" +#POLICY_KIND="" +POLICY_KIND="" diff --git a/test/mbind/testcases/0041_mbind.txt b/test/mbind/testcases/0041_mbind.txt new file mode 100644 index 00000000..f726cc99 --- /dev/null +++ b/test/mbind/testcases/0041_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 16`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind_shared 0x8002 0x1 1 0x8001 0x1 1 0 1" +OS_IDX=0 +#POLICY_KIND="" +#POLICY_KIND="" +POLICY_KIND="" diff --git a/test/mbind/testcases/0042_mbind.txt b/test/mbind/testcases/0042_mbind.txt new file mode 100644 index 00000000..c4b0bb42 --- /dev/null +++ b/test/mbind/testcases/0042_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 16`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind_shared 0x8003 0x1 1 0x8000 0x0 1 0 1" +OS_IDX=0 +#POLICY_KIND="" +#POLICY_KIND="" +POLICY_KIND="" diff --git a/test/mbind/testcases/0043_mbind.txt b/test/mbind/testcases/0043_mbind.txt new file mode 100644 index 00000000..1c6b23f9 --- /dev/null +++ b/test/mbind/testcases/0043_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 16`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 2 0x8000 0x0 2 1 1" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0044_mbind.txt b/test/mbind/testcases/0044_mbind.txt new file mode 100644 index 00000000..a1acc058 --- /dev/null +++ b/test/mbind/testcases/0044_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 16`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 2 0x8001 0x3 2 0 1" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0045_mbind.txt b/test/mbind/testcases/0045_mbind.txt new file mode 100644 index 00000000..d6f42e99 --- /dev/null +++ b/test/mbind/testcases/0045_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 16`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 2 0x8002 0x3 2 0 1" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0046_mbind.txt b/test/mbind/testcases/0046_mbind.txt new file mode 100644 index 00000000..dccc081d --- /dev/null +++ b/test/mbind/testcases/0046_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 16`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 2 0x8003 0x3 2 0 1" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0047_mbind.txt b/test/mbind/testcases/0047_mbind.txt new file mode 100644 index 00000000..417ef910 --- /dev/null +++ b/test/mbind/testcases/0047_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 16`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 2 0x80ff 0x3 2 0 4" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0048_mbind.txt b/test/mbind/testcases/0048_mbind.txt new file mode 100644 index 00000000..c139df02 --- /dev/null +++ b/test/mbind/testcases/0048_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 16`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 2 0x80ff 0x3 2 0 40" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0049_mbind.txt b/test/mbind/testcases/0049_mbind.txt new file mode 100644 index 00000000..a7ebaf1a --- /dev/null +++ b/test/mbind/testcases/0049_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 16`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 2 0x8000 0x0 2 1 1" +OS_IDX=0 +#POLICY_KIND="" +POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0050_mbind.txt b/test/mbind/testcases/0050_mbind.txt new file mode 100644 index 00000000..2a8f07cd --- /dev/null +++ b/test/mbind/testcases/0050_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 16`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8001 0x3 2 0x8000 0x0 2 1 1" +OS_IDX=0 +#POLICY_KIND="" +POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0051_mbind.txt b/test/mbind/testcases/0051_mbind.txt new file mode 100644 index 00000000..3ff7e5ea --- /dev/null +++ b/test/mbind/testcases/0051_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 16`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8002 0x3 2 0x8000 0x0 2 1 1" +OS_IDX=0 +#POLICY_KIND="" +POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0052_mbind.txt b/test/mbind/testcases/0052_mbind.txt new file mode 100644 index 00000000..1d74bfc5 --- /dev/null +++ b/test/mbind/testcases/0052_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 16`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8003 0x3 2 0x8000 0x0 2 1 1" +OS_IDX=0 +#POLICY_KIND="" +POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0053_mbind.txt b/test/mbind/testcases/0053_mbind.txt new file mode 100644 index 00000000..bef9677e --- /dev/null +++ b/test/mbind/testcases/0053_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 16`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind_shared 0x8000 0x0 2 0x8003 0x3 2 0 1" +OS_IDX=0 +#POLICY_KIND="" +#POLICY_KIND="" +POLICY_KIND="" diff --git a/test/mbind/testcases/0054_mbind.txt b/test/mbind/testcases/0054_mbind.txt new file mode 100644 index 00000000..6df03b97 --- /dev/null +++ b/test/mbind/testcases/0054_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 16`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind_shared 0x8001 0x3 2 0x8002 0x3 2 0 1" +OS_IDX=0 +#POLICY_KIND="" +#POLICY_KIND="" +POLICY_KIND="" diff --git a/test/mbind/testcases/0055_mbind.txt b/test/mbind/testcases/0055_mbind.txt new file mode 100644 index 00000000..e43c4f6d --- /dev/null +++ b/test/mbind/testcases/0055_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 16`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind_shared 0x8002 0x3 2 0x8001 0x3 2 0 1" +OS_IDX=0 +#POLICY_KIND="" +#POLICY_KIND="" +POLICY_KIND="" diff --git a/test/mbind/testcases/0056_mbind.txt b/test/mbind/testcases/0056_mbind.txt new file mode 100644 index 00000000..c450a131 --- /dev/null +++ b/test/mbind/testcases/0056_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 16`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind_shared 0x8003 0x3 2 0x8000 0x0 2 0 1" +OS_IDX=0 +#POLICY_KIND="" +#POLICY_KIND="" +POLICY_KIND="" diff --git a/test/mbind/testcases/0057_mbind.txt b/test/mbind/testcases/0057_mbind.txt new file mode 100644 index 00000000..bfe8addd --- /dev/null +++ b/test/mbind/testcases/0057_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 128`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 1 0x8000 0x0 1 1 1" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0058_mbind.txt b/test/mbind/testcases/0058_mbind.txt new file mode 100644 index 00000000..511a9bb9 --- /dev/null +++ b/test/mbind/testcases/0058_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 128`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 1 0x8001 0x1 1 0 1" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0059_mbind.txt b/test/mbind/testcases/0059_mbind.txt new file mode 100644 index 00000000..3d1c5d2c --- /dev/null +++ b/test/mbind/testcases/0059_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 128`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 1 0x8002 0x1 1 0 1" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0060_mbind.txt b/test/mbind/testcases/0060_mbind.txt new file mode 100644 index 00000000..ac9d5623 --- /dev/null +++ b/test/mbind/testcases/0060_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 128`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 1 0x8003 0x1 1 0 1" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0061_mbind.txt b/test/mbind/testcases/0061_mbind.txt new file mode 100644 index 00000000..d5377d55 --- /dev/null +++ b/test/mbind/testcases/0061_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 128`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 1 0x80ff 0x1 1 0 4" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0062_mbind.txt b/test/mbind/testcases/0062_mbind.txt new file mode 100644 index 00000000..6da5323b --- /dev/null +++ b/test/mbind/testcases/0062_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 128`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 1 0x80ff 0x1 1 0 40" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0063_mbind.txt b/test/mbind/testcases/0063_mbind.txt new file mode 100644 index 00000000..ecc7bb0e --- /dev/null +++ b/test/mbind/testcases/0063_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 128`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 1 0x8000 0x0 1 1 1" +OS_IDX=0 +#POLICY_KIND="" +POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0064_mbind.txt b/test/mbind/testcases/0064_mbind.txt new file mode 100644 index 00000000..4c8877c8 --- /dev/null +++ b/test/mbind/testcases/0064_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 128`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8001 0x1 1 0x8000 0x0 1 1 1" +OS_IDX=0 +#POLICY_KIND="" +POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0065_mbind.txt b/test/mbind/testcases/0065_mbind.txt new file mode 100644 index 00000000..4147ca9e --- /dev/null +++ b/test/mbind/testcases/0065_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 128`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8002 0x1 1 0x8000 0x0 1 1 1" +OS_IDX=0 +#POLICY_KIND="" +POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0066_mbind.txt b/test/mbind/testcases/0066_mbind.txt new file mode 100644 index 00000000..8c393aa7 --- /dev/null +++ b/test/mbind/testcases/0066_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 128`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8003 0x1 1 0x8000 0x0 1 1 1" +OS_IDX=0 +#POLICY_KIND="" +POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0067_mbind.txt b/test/mbind/testcases/0067_mbind.txt new file mode 100644 index 00000000..2ead507b --- /dev/null +++ b/test/mbind/testcases/0067_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 128`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind_shared 0x8000 0x0 1 0x8003 0x1 1 0 1" +OS_IDX=0 +#POLICY_KIND="" +#POLICY_KIND="" +POLICY_KIND="" diff --git a/test/mbind/testcases/0068_mbind.txt b/test/mbind/testcases/0068_mbind.txt new file mode 100644 index 00000000..4d974d58 --- /dev/null +++ b/test/mbind/testcases/0068_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 128`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind_shared 0x8001 0x1 1 0x8002 0x1 1 0 1" +OS_IDX=0 +#POLICY_KIND="" +#POLICY_KIND="" +POLICY_KIND="" diff --git a/test/mbind/testcases/0069_mbind.txt b/test/mbind/testcases/0069_mbind.txt new file mode 100644 index 00000000..a3a24aec --- /dev/null +++ b/test/mbind/testcases/0069_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 128`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind_shared 0x8002 0x1 1 0x8001 0x1 1 0 1" +OS_IDX=0 +#POLICY_KIND="" +#POLICY_KIND="" +POLICY_KIND="" diff --git a/test/mbind/testcases/0070_mbind.txt b/test/mbind/testcases/0070_mbind.txt new file mode 100644 index 00000000..f2c318ea --- /dev/null +++ b/test/mbind/testcases/0070_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 128`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind_shared 0x8003 0x1 1 0x8000 0x0 1 0 1" +OS_IDX=0 +#POLICY_KIND="" +#POLICY_KIND="" +POLICY_KIND="" diff --git a/test/mbind/testcases/0071_mbind.txt b/test/mbind/testcases/0071_mbind.txt new file mode 100644 index 00000000..a4ef00e0 --- /dev/null +++ b/test/mbind/testcases/0071_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 128`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 2 0x8000 0x0 2 1 1" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0072_mbind.txt b/test/mbind/testcases/0072_mbind.txt new file mode 100644 index 00000000..9444a8d2 --- /dev/null +++ b/test/mbind/testcases/0072_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 128`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 2 0x8001 0x3 2 0 1" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0073_mbind.txt b/test/mbind/testcases/0073_mbind.txt new file mode 100644 index 00000000..9a27715f --- /dev/null +++ b/test/mbind/testcases/0073_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 128`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 2 0x8002 0x3 2 0 1" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0074_mbind.txt b/test/mbind/testcases/0074_mbind.txt new file mode 100644 index 00000000..277db5bd --- /dev/null +++ b/test/mbind/testcases/0074_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 128`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 2 0x8003 0x3 2 0 1" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0075_mbind.txt b/test/mbind/testcases/0075_mbind.txt new file mode 100644 index 00000000..5b16579f --- /dev/null +++ b/test/mbind/testcases/0075_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 128`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 2 0x80ff 0x3 2 0 4" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0076_mbind.txt b/test/mbind/testcases/0076_mbind.txt new file mode 100644 index 00000000..75351cc9 --- /dev/null +++ b/test/mbind/testcases/0076_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 128`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 2 0x80ff 0x3 2 0 40" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0077_mbind.txt b/test/mbind/testcases/0077_mbind.txt new file mode 100644 index 00000000..43655002 --- /dev/null +++ b/test/mbind/testcases/0077_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 128`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 2 0x8000 0x0 2 1 1" +OS_IDX=0 +#POLICY_KIND="" +POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0078_mbind.txt b/test/mbind/testcases/0078_mbind.txt new file mode 100644 index 00000000..27d36939 --- /dev/null +++ b/test/mbind/testcases/0078_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 128`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8001 0x3 2 0x8000 0x0 2 1 1" +OS_IDX=0 +#POLICY_KIND="" +POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0079_mbind.txt b/test/mbind/testcases/0079_mbind.txt new file mode 100644 index 00000000..12ffb8e4 --- /dev/null +++ b/test/mbind/testcases/0079_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 128`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8002 0x3 2 0x8000 0x0 2 1 1" +OS_IDX=0 +#POLICY_KIND="" +POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0080_mbind.txt b/test/mbind/testcases/0080_mbind.txt new file mode 100644 index 00000000..dae3fc6f --- /dev/null +++ b/test/mbind/testcases/0080_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 128`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8003 0x3 2 0x8000 0x0 2 1 1" +OS_IDX=0 +#POLICY_KIND="" +POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0081_mbind.txt b/test/mbind/testcases/0081_mbind.txt new file mode 100644 index 00000000..119cbd9f --- /dev/null +++ b/test/mbind/testcases/0081_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 128`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind_shared 0x8000 0x0 2 0x8003 0x3 2 0 1" +OS_IDX=0 +#POLICY_KIND="" +#POLICY_KIND="" +POLICY_KIND="" diff --git a/test/mbind/testcases/0082_mbind.txt b/test/mbind/testcases/0082_mbind.txt new file mode 100644 index 00000000..8a066ede --- /dev/null +++ b/test/mbind/testcases/0082_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 128`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind_shared 0x8001 0x3 2 0x8002 0x3 2 0 1" +OS_IDX=0 +#POLICY_KIND="" +#POLICY_KIND="" +POLICY_KIND="" diff --git a/test/mbind/testcases/0083_mbind.txt b/test/mbind/testcases/0083_mbind.txt new file mode 100644 index 00000000..57f8218e --- /dev/null +++ b/test/mbind/testcases/0083_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 128`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind_shared 0x8002 0x3 2 0x8001 0x3 2 0 1" +OS_IDX=0 +#POLICY_KIND="" +#POLICY_KIND="" +POLICY_KIND="" diff --git a/test/mbind/testcases/0084_mbind.txt b/test/mbind/testcases/0084_mbind.txt new file mode 100644 index 00000000..aeeb9df3 --- /dev/null +++ b/test/mbind/testcases/0084_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 128`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind_shared 0x8003 0x3 2 0x8000 0x0 2 0 1" +OS_IDX=0 +#POLICY_KIND="" +#POLICY_KIND="" +POLICY_KIND="" diff --git a/test/mbind/testcases/0085_mbind.txt b/test/mbind/testcases/0085_mbind.txt new file mode 100644 index 00000000..acba0c5b --- /dev/null +++ b/test/mbind/testcases/0085_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 1`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 1 0x8000 0x1 1 1 1" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0086_mbind.txt b/test/mbind/testcases/0086_mbind.txt new file mode 100644 index 00000000..cbd621cf --- /dev/null +++ b/test/mbind/testcases/0086_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 1`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 1 0x8002 0x0 1 0 1" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0087_mbind.txt b/test/mbind/testcases/0087_mbind.txt new file mode 100644 index 00000000..48e498e3 --- /dev/null +++ b/test/mbind/testcases/0087_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 1`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 1 0x8003 0x0 1 0 1" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0088_mbind.txt b/test/mbind/testcases/0088_mbind.txt new file mode 100644 index 00000000..8529d07a --- /dev/null +++ b/test/mbind/testcases/0088_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 1`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 1 0x8001 0x1 1 1 1" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0089_mbind.txt b/test/mbind/testcases/0089_mbind.txt new file mode 100644 index 00000000..bf2fbeb6 --- /dev/null +++ b/test/mbind/testcases/0089_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 1`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 1 0x8002 0x1 1 1 1" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0090_mbind.txt b/test/mbind/testcases/0090_mbind.txt new file mode 100644 index 00000000..8f84ec11 --- /dev/null +++ b/test/mbind/testcases/0090_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 1`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 1 0x8003 0x1 1 1 1" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0091_mbind.txt b/test/mbind/testcases/0091_mbind.txt new file mode 100644 index 00000000..7e806bef --- /dev/null +++ b/test/mbind/testcases/0091_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 1`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 1 0xc001 0x1 1 0 1" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0092_mbind.txt b/test/mbind/testcases/0092_mbind.txt new file mode 100644 index 00000000..c920788e --- /dev/null +++ b/test/mbind/testcases/0092_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 1`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x1 1 0x8000 0x0 1 1 1" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0093_mbind.txt b/test/mbind/testcases/0093_mbind.txt new file mode 100644 index 00000000..86625b66 --- /dev/null +++ b/test/mbind/testcases/0093_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 1`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8001 0x0 1 0x8000 0x0 1 1 1" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0094_mbind.txt b/test/mbind/testcases/0094_mbind.txt new file mode 100644 index 00000000..e388a43c --- /dev/null +++ b/test/mbind/testcases/0094_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 1`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8002 0x0 1 0x8000 0x0 1 1 1" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0095_mbind.txt b/test/mbind/testcases/0095_mbind.txt new file mode 100644 index 00000000..f088eb9c --- /dev/null +++ b/test/mbind/testcases/0095_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 1`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8003 0x0 1 0x8000 0x0 1 1 1" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0096_mbind.txt b/test/mbind/testcases/0096_mbind.txt new file mode 100644 index 00000000..cc702c50 --- /dev/null +++ b/test/mbind/testcases/0096_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 16`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 1 0x8000 0x1 1 1 1" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0097_mbind.txt b/test/mbind/testcases/0097_mbind.txt new file mode 100644 index 00000000..1277a0ae --- /dev/null +++ b/test/mbind/testcases/0097_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 16`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 1 0x8002 0x0 1 0 1" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0098_mbind.txt b/test/mbind/testcases/0098_mbind.txt new file mode 100644 index 00000000..d9c91228 --- /dev/null +++ b/test/mbind/testcases/0098_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 16`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 1 0x8003 0x0 1 0 1" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0099_mbind.txt b/test/mbind/testcases/0099_mbind.txt new file mode 100644 index 00000000..a30b365c --- /dev/null +++ b/test/mbind/testcases/0099_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 16`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 1 0x8001 0x1 1 1 1" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/testcases/0100_mbind.txt b/test/mbind/testcases/0100_mbind.txt new file mode 100644 index 00000000..7e6b1abf --- /dev/null +++ b/test/mbind/testcases/0100_mbind.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 16`" +USR_PROC="mcexec_test_proc/exec_setmempolicy_mbind 0x8000 0x0 1 0x8002 0x1 1 1 1" +OS_IDX=0 +POLICY_KIND="" +#POLICY_KIND="" +#POLICY_KIND="" diff --git a/test/mbind/utils/gen_mem_chunks.sh b/test/mbind/utils/gen_mem_chunks.sh new file mode 100755 index 00000000..ce81c872 --- /dev/null +++ b/test/mbind/utils/gen_mem_chunks.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +NUMAS=$1 +MEM_SIZE=$2 +REP=$3 +CHUNKS="" + +for numa in ${NUMAS} +do + for rep in `seq 1 ${REP}` + do + CHUNKS="${CHUNKS}${MEM_SIZE}@${numa}," + done +done + +echo ${CHUNKS%,} diff --git a/test/mbind/utils/kill_mcexec.sh b/test/mbind/utils/kill_mcexec.sh new file mode 100755 index 00000000..74c4d6d2 --- /dev/null +++ b/test/mbind/utils/kill_mcexec.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +count=`pgrep -c -f 'mcexec '` +if [ ${count} -gt 0 ] +then + echo "kill process :" ${count} + pgrep -l -f 'mcexec ' + pgrep -f 'mcexec ' | xargs kill -9 +fi +