Home
last modified time | relevance | path

Searched refs:hpage_size (Results 1 – 25 of 46) sorted by relevance

12

/third_party/ltp/testcases/kernel/mem/hugetlb/hugemmap/
Dhugemmap25.c24 static long hpage_size; variable
31 a = SAFE_MMAP(NULL, hpage_size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); in do_remap()
33 ret = do_readback(a, hpage_size, "base huge"); in do_remap()
37 b = mremap(a, hpage_size, hpage_size, MREMAP_MAYMOVE | MREMAP_FIXED, in do_remap()
41 ret = do_readback(b, hpage_size, "remapped"); in do_remap()
48 SAFE_MUNMAP(a, hpage_size); in do_remap()
80 p = map_align(3*hpage_size, hpage_size); in run_test()
82 SAFE_MUNMAP(p, hpage_size); in run_test()
83 SAFE_MUNMAP(p + 2*hpage_size, hpage_size); in run_test()
85 p = p + hpage_size; in run_test()
[all …]
Dhugemmap18.c34 static long hpage_size; variable
46 p = mmap(NULL, hpage_size, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0); in run_test()
51 if (((unsigned long)p % hpage_size) != 0) { in run_test()
56 tst_res(TINFO, "Mapped at %p, length 0x%lx", p, hpage_size); in run_test()
58 SAFE_MUNMAP(p, hpage_size); in run_test()
61 q = mmap(p + page_size, hpage_size, PROT_READ|PROT_WRITE, in run_test()
68 if (((unsigned long)q % hpage_size) != 0) { in run_test()
72 SAFE_MUNMAP(q, hpage_size); in run_test()
75 q = mmap(p + page_size, hpage_size, PROT_READ|PROT_WRITE, in run_test()
89 SAFE_MUNMAP(q, hpage_size); in run_test()
[all …]
Dhugemmap24.c26 static unsigned long hpage_size, page_size; variable
51 while (slice_boundary + slice_size < (unsigned long)heap + 2*hpage_size) in init_slice_boundary()
60 p = mmap((void *)(slice_boundary-2*hpage_size), 4*hpage_size, in init_slice_boundary()
66 SAFE_MUNMAP(p, 4*hpage_size); in init_slice_boundary()
94 p_size = hpage_size; in run_test()
95 p = SAFE_MMAP((void *)(slice_boundary + hpage_size), p_size, in run_test()
133 p = SAFE_MMAP((void *)(slice_boundary + hpage_size), p_size, in run_test()
141 q_size = hpage_size; in run_test()
142 q = SAFE_MMAP((void *)(slice_boundary - hpage_size), in run_test()
150 r = mremap(q, hpage_size, 2*hpage_size, 0); in run_test()
[all …]
Dhugemmap29.c23 static unsigned long hpage_size; variable
33 p = SAFE_MMAP(NULL, hpage_size, PROT_READ|PROT_WRITE, MAP_SHARED, in run_test()
37 for (i = 0; i < (hpage_size / sizeof(*pl)); i++) in run_test()
40 q = SAFE_MMAP(NULL, hpage_size, PROT_READ|PROT_WRITE, MAP_PRIVATE, in run_test()
44 for (i = 0; i < (hpage_size / sizeof(*ql)); i++) { in run_test()
52 for (i = 0; i < (hpage_size / sizeof(*ql)); i++) in run_test()
55 for (i = 0; i < (hpage_size / sizeof(*ql)); i++) { in run_test()
63 for (i = 0; i < (hpage_size / sizeof(*pl)); i++) { in run_test()
71 memset(p, 0, hpage_size); in run_test()
73 for (i = 0; i < (hpage_size / sizeof(*ql)); i++) { in run_test()
[all …]
Dhugemmap22.c22 static unsigned long hpage_size; variable
30 size_t size = NR_HUGEPAGES*hpage_size; in run_test()
36 for (j = 0; j < hpage_size; j++) { in run_test()
37 if (*(m+(i*hpage_size)+j) != 0) { in run_test()
40 *(m+(i*hpage_size)+j)); in run_test()
48 memset(m+(i*hpage_size), pattern, hpage_size); in run_test()
53 for (j = 0; j < hpage_size; j++) { in run_test()
54 if (*(m+(i*hpage_size)+j) != pattern) { in run_test()
57 *(m+(i*hpage_size)+j), pattern); in run_test()
72 hpage_size = tst_get_hugepage_size(); in setup()
Dhugemmap19.c35 static long hpage_size; variable
60 p = SAFE_MMAP(NULL, 2*hpage_size, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0); in run_test()
64 tst_res(TINFO, "Mapped Address Range: %p-%p", p, p+2*hpage_size-1); in run_test()
66 memset(p, 0, 2*hpage_size); in run_test()
80 err = mprotect(p, hpage_size, PROT_READ); in run_test()
82 tst_brk(TBROK|TERRNO, "mprotect(%p, 0x%lx, PROT_READ)", p, hpage_size); in run_test()
87 p + hpage_size, (unsigned long)buggy_offset); in run_test()
88 q = mmap(p + hpage_size, hpage_size, PROT_READ|PROT_WRITE, in run_test()
119 SAFE_MUNMAP(p, 2*hpage_size); in run_test()
125 hpage_size = SAFE_READ_MEMINFO("Hugepagesize:")*1024; in setup()
Dhugemmap26.c24 static long hpage_size, page_size; variable
59 p = SAFE_MMAP(NULL, 3*hpage_size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); in run_test()
61 SAFE_MUNMAP(p, hpage_size); in run_test()
63 SAFE_MUNMAP(p + 2*hpage_size, hpage_size); in run_test()
65 p = p + hpage_size; in run_test()
69 ret = do_readback(p, hpage_size, "base hugepage"); in run_test()
77 ret = do_remap(p + hpage_size); in run_test()
82 SAFE_MUNMAP(p, hpage_size); in run_test()
88 hpage_size = tst_get_hugepage_size(); in setup()
Dhugemmap20.c19 static unsigned long hpage_size; variable
38 p = SAFE_MMAP(0, hpage_size, PROT_READ|PROT_WRITE, tc->flags, fd, 0); in run_test()
40 ret = mlock(p, hpage_size); in run_test()
46 ret = munlock(p, hpage_size); in run_test()
53 SAFE_MUNMAP(p, hpage_size); in run_test()
61 hpage_size = tst_get_hugepage_size(); in setup()
64 if (limit_info.rlim_cur < hpage_size) { in setup()
65 limit_info.rlim_max = hpage_size; in setup()
66 limit_info.rlim_cur = hpage_size; in setup()
Dhugemmap09.c26 static long hpage_size; variable
34 p = SAFE_MMAP(NULL, hpage_size, PROT_READ|PROT_WRITE, MAP_SHARED, in run_test()
38 SAFE_MUNMAP(p, hpage_size); in run_test()
40 p = SAFE_MMAP(NULL, hpage_size, PROT_READ|PROT_WRITE, MAP_PRIVATE, in run_test()
44 SAFE_MUNMAP(p, hpage_size); in run_test()
46 p = SAFE_MMAP(NULL, hpage_size, PROT_READ|PROT_WRITE, MAP_SHARED, in run_test()
50 SAFE_MUNMAP(p, hpage_size); in run_test()
61 hpage_size = SAFE_READ_MEMINFO(MEMINFO_HPAGE_SIZE)*1024; in setup()
Dhugemmap08.c37 static long hpage_size; variable
55 p = SAFE_MMAP(NULL, chunk1*hpage_size, PROT_READ|PROT_WRITE, MAP_SHARED, in test_chunk_overcommit()
58 q = mmap(NULL, chunk2*hpage_size, PROT_READ|PROT_WRITE, MAP_SHARED, in test_chunk_overcommit()
59 huge_fd, chunk1*hpage_size); in test_chunk_overcommit()
79 memset(p, 0, chunk1*hpage_size); in test_chunk_overcommit()
80 memset(q, 0, chunk2*hpage_size); in test_chunk_overcommit()
95 SAFE_MUNMAP(q, chunk2*hpage_size); in test_chunk_overcommit()
98 SAFE_MUNMAP(p, chunk1*hpage_size); in test_chunk_overcommit()
119 hpage_size = SAFE_READ_MEMINFO(MEMINFO_HPAGE_SIZE)*1024; in setup()
Dhugemmap31.c20 static long hpage_size; variable
30 p = SAFE_MMAP(NULL, hpage_size, PROT_READ|PROT_WRITE, MAP_SHARED, in run_test()
33 q = SAFE_MMAP(NULL, hpage_size, PROT_READ|PROT_WRITE, MAP_SHARED, in run_test()
37 for (i = 0; i < (hpage_size / sizeof(*pl)); i++) in run_test()
41 for (i = 0; i < (hpage_size / sizeof(*ql)); i++) { in run_test()
51 SAFE_MUNMAP(p, hpage_size); in run_test()
52 SAFE_MUNMAP(q, hpage_size); in run_test()
58 hpage_size = tst_get_hugepage_size(); in setup()
Dhugemmap23.c23 static long hpage_size; variable
172 p = SAFE_MMAP(NULL, tc->len1*hpage_size, tc->prot1, MAP_SHARED, fd, 0); in run_test()
178 ret = mprotect(p, tc->len2*hpage_size, tc->prot2); in run_test()
190 ret = test_prot(p + tc->len2*hpage_size, tc->prot1, tc->prot1_str); in run_test()
195 SAFE_MUNMAP(p, tc->len1*hpage_size); in run_test()
205 hpage_size = tst_get_hugepage_size(); in setup()
209 addr = SAFE_MMAP(NULL, 2*hpage_size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); in setup()
210 memset(addr, 0, hpage_size); in setup()
211 SAFE_MUNMAP(addr, hpage_size); in setup()
216 SAFE_MUNMAP(addr+hpage_size, hpage_size); in cleanup()
Dhugemmap07.c27 static long hpage_size; variable
42 return PALIGN(addr, hpage_size); in next_chunk()
54 return PALIGN(addr, hpage_size); in next_chunk()
66 return PALIGN(addr, hpage_size); in next_chunk()
79 hugemap_addr = next_chunk(brk0) + hpage_size; in run_test()
81 p = SAFE_MMAP(hugemap_addr, hpage_size, PROT_READ|PROT_WRITE, in run_test()
106 SAFE_MUNMAP(p, hpage_size); in run_test()
114 hpage_size = SAFE_READ_MEMINFO(MEMINFO_HPAGE_SIZE)*1024; in setup()
Dhugemmap28.c18 static long hpage_size; variable
30 p = SAFE_MMAP(NULL, hpage_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); in run_test()
32 q = SAFE_MMAP(NULL, hpage_size, in run_test()
37 SAFE_MUNMAP(p, hpage_size); in run_test()
38 SAFE_MUNMAP(q, hpage_size); in run_test()
48 hpage_size = tst_get_hugepage_size(); in setup()
Dhugemmap30.c22 static long hpage_size; variable
33 p = SAFE_MMAP(NULL, hpage_size, PROT_READ|PROT_WRITE, MAP_SHARED, in run_test()
38 readahead(fd, 0, hpage_size); in run_test()
42 memset(p, 1, hpage_size); in run_test()
44 SAFE_MUNMAP(p, hpage_size); in run_test()
53 hpage_size = tst_get_hugepage_size(); in setup()
Dhugemmap12.c28 static long hpage_size; variable
41 p = SAFE_MMAP(NULL, hpage_size, PROT_READ|PROT_WRITE, MAP_SHARED, in run_test()
46 SAFE_POSIX_FADVISE(fd, 0, hpage_size, POSIX_FADV_WILLNEED); in run_test()
50 memset(p, 1, hpage_size); in run_test()
52 SAFE_MUNMAP(p, hpage_size); in run_test()
62 hpage_size = SAFE_READ_MEMINFO(MEMINFO_HPAGE_SIZE)*1024; in setup()
Dhugemmap17.c35 #define MAP_LENGTH (4UL * hpage_size)
44 static unsigned long hpage_size; variable
61 for (i = 0; i < MAP_LENGTH; i += hpage_size) in run_test()
76 hpage_size = SAFE_READ_MEMINFO("Hugepagesize:")*1024; in setup()
78 if (hpage_size > TRUNCATE_POINT) in setup()
80 if (TRUNCATE_POINT % hpage_size) in setup()
Dhugemmap14.c30 static unsigned long long hpage_size; variable
44 lowaddr = FOURGB - hpage_size; in run_test()
46 p = mmap((void *)lowaddr, hpage_size, PROT_READ|PROT_WRITE, in run_test()
65 memset(p, 0, hpage_size); in run_test()
121 SAFE_MUNMAP(p, hpage_size); in run_test()
131 hpage_size = SAFE_READ_MEMINFO("Hugepagesize:")*1024; in setup()
135 if (hpage_size > FOURGB) in setup()
Dhugemmap15.c43 static long hpage_size; variable
126 && (PALIGN(sig_expected, hpage_size) in sig_handler()
172 p = SAFE_MMAP(NULL, 2*hpage_size, PROT_READ|PROT_WRITE|PROT_EXEC, in test_once()
175 SAFE_FTRUNCATE(fd, hpage_size); in test_once()
177 q = p + hpage_size - COPY_SIZE; in test_once()
182 p = SAFE_MMAP(p, hpage_size, PROT_READ|PROT_WRITE|PROT_EXEC, in test_once()
185 q = p + hpage_size - COPY_SIZE; in test_once()
220 hpage_size = SAFE_READ_MEMINFO("Hugepagesize:")*1024; in setup()
Dhugemmap27.c20 static long hpage_size; variable
69 p = SAFE_MMAP(NULL, hpage_size * nr_hugepages, in run_test()
74 q = SAFE_MMAP(NULL, hpage_size, in run_test()
95 SAFE_MUNMAP(p, hpage_size * nr_hugepages); in run_test()
96 SAFE_MUNMAP(q, hpage_size); in run_test()
101 hpage_size = tst_get_hugepage_size(); in setup()
Dhugemmap13.c30 static unsigned long hpage_size; variable
40 p = mmap((void *)FOURGB, hpage_size, PROT_READ|PROT_WRITE, in run_test()
62 memset(p, 0, hpage_size); in run_test()
90 SAFE_MUNMAP(p, hpage_size); in run_test()
98 hpage_size = SAFE_READ_MEMINFO("Hugepagesize:")*1024; in setup()
102 if (hpage_size > FOURGB) in setup()
Dhugemmap06.c30 static long hpage_size; variable
42 hpage_size = SAFE_READ_MEMINFO("Hugepagesize:") * 1024; in setup()
56 *(mmap_sz->addr + b * hpage_size) = rand(); in thr()
69 addr = mmap(NULL, sz * hpage_size, in do_mmap()
92 new_addr = mmap(addr, (sz - 1) * hpage_size, in do_mmap()
110 if (munmap(addr, sz * hpage_size) == -1) in do_mmap()
Dhugemmap16.c29 static long hpage_size; variable
41 p = SAFE_MMAP(NULL, hpage_size, PROT_READ|PROT_WRITE, MAP_SHARED, in run_test()
46 if (madvise(p, hpage_size, MADV_WILLNEED) == -1) in run_test()
51 SAFE_MUNMAP(p, hpage_size); in run_test()
61 hpage_size = SAFE_READ_MEMINFO("Hugepagesize:")*1024; in setup()
/third_party/ltp/testcases/kernel/mem/hugetlb/hugeshmat/
Dhugeshmat05.c32 static long hpage_size; variable
39 hpage_size = SAFE_READ_MEMINFO("Hugepagesize:") * 1024; in setup()
74 N * hpage_size - page_size, in test_hugeshmat()
75 N * hpage_size - page_size - 1, in test_hugeshmat()
76 hpage_size, in test_hugeshmat()
77 hpage_size + 1 in test_hugeshmat()
/third_party/ltp/testcases/kernel/mem/hugetlb/hugefallocate/
Dhugefallocate01.c29 static long hpage_size; variable
80 0, (2 * hpage_size) - 1); in run_test()
98 err = fallocate(fd, 0, 1, hpage_size); in run_test()
119 1, hpage_size); in run_test()
137 0, 2 * hpage_size); in run_test()
151 hpage_size = SAFE_READ_MEMINFO(MEMINFO_HPAGE_SIZE)*1024; in setup()

12