Home
last modified time | relevance | path

Searched refs:pagesize (Results 1 – 25 of 79) sorted by relevance

1234

/third_party/ltp/testcases/kernel/mem/mmapstress/
Dmmapstress03.c67 static void do_test(void* brk_max, long pagesize);
72 size_t pagesize = (size_t) sysconf(_SC_PAGE_SIZE); in main() local
79 if ((u_long) brk_start % (u_long) pagesize) { in main()
80 if (sbrk(pagesize - ((u_long) brk_start % (u_long) pagesize)) in main()
88 if ((hole_addr = hole_start = sbrk(NUM_SEGS * 2 * pagesize)) == NEG1) { in main()
96 do_test((void*) brk_max_addr, pagesize); in main()
99 while (hole_addr + pagesize < brk_max_addr) { in main()
100 if (munmap(hole_addr, pagesize) == -1) { in main()
104 hole_addr += 2 * pagesize; in main()
111 do_test((void*) brk_max_addr, pagesize); in main()
[all …]
Dmmapstress05.c62 if (munmap(mmapaddr+pagesize, pagesize) == -1) { \
65 if (munmap(mmapaddr, pagesize) == -1) { \
68 if (munmap(mmapaddr+2*pagesize, pagesize) == -1) { \
106 size_t pagesize = (size_t) sysconf(_SC_PAGE_SIZE); in main() local
121 if (sbrk(pagesize - ((ulong) sbrk(0) & (pagesize - 1))) == (char *)-1) { in main()
125 if ((buf = sbrk(pagesize)) == (char *)-1) { in main()
153 for (i = 0; i < pagesize; i++) in main()
155 if (write(fd, buf, pagesize) != pagesize) { in main()
159 if (lseek(fd, MMU_NARROWPTEPG * pagesize, SEEK_SET) == -1) { in main()
163 if (write(fd, buf, pagesize) != pagesize) { in main()
[all …]
Dmmapstress07.c87 size_t pagesize = (size_t) sysconf(_SC_PAGE_SIZE); local
127 holesize = pagesize;
141 sparseoff = pagesize * 2;
178 while (i < pagesize && write(rwfd, "a", 1) == 1)
180 if (i != pagesize) {
194 while (i < (pagesize >> 1) && write(rwfd, "b", 1) == 1)
196 if (i != (pagesize >> 1)) {
205 if ((mapaddr = mmap64((caddr_t) 0, pagesize * 2 + holesize, PROT_READ,
209 if ((mapaddr = mmap((caddr_t) 0, pagesize * 2 + holesize, PROT_READ,
217 while (i < 2 * pagesize && write(rwfd, "c", 1) == 1)
[all …]
Dmmapstress02.c83 size_t pagesize = sysconf(_SC_PAGE_SIZE); in main() local
111 if (sbrk(2 * pagesize - ((ulong) sbrk(0) & (pagesize - 1))) == in main()
123 for (i = pagesize; i; i--) in main()
125 if (write(fd, (char *)mmapaddr - pagesize, pagesize) != pagesize) { in main()
129 if (mmap(mmapaddr, pagesize, PROT_NONE, in main()
142 if (read(fd, (char *)mmapaddr, pagesize) != -1) { in main()
150 if (write(fd, (char *)mmapaddr, pagesize) != -1) { in main()
162 if (munmap(mmapaddr, pagesize) == -1) { in main()
Dmmapstress01.c147 int pagesize = sysconf(_SC_PAGE_SIZE); local
210 if (sparseoffset % pagesize != 0) {
291 if ((buf = malloc(pagesize)) == NULL
300 for (i = 0, data = 0; i < pagesize; i++) {
314 write_cnt = min(pagesize, bytes_left);
473 size_t pagesize = sysconf(_SC_PAGE_SIZE); local
507 mappages = roundup(mapsize, pagesize) / pagesize;
511 int byteoffset = pageoffset * pagesize;
523 offset / pagesize, nloops);
528 offset / pagesize, nloops);
[all …]
Dmmapstress10.c175 int pagesize = sysconf(_SC_PAGE_SIZE); local
254 if (sparseoffset % pagesize != 0) {
334 if ((buf = malloc(pagesize + growsize)) == NULL
343 for (i = 0, data = 0; i < pagesize; i++) {
348 for (data = 0; i < pagesize + growsize; i++) {
364 write_cnt = min(pagesize, bytes_left);
535 int pagesize = sysconf(_SC_PAGE_SIZE); local
583 mappages = roundup(mapsize_mapper, pagesize) / pagesize;
587 int byteoffset = pageoffset * pagesize;
614 offset / pagesize, nloops);
[all …]
Dmmapstress09.c106 int pagesize; variable
132 pagesize = sysconf(_SC_PAGE_SIZE); in main()
200 if ((buf = malloc(pagesize)) == NULL in main()
213 for (i = 0, data = 0; i < pagesize; i++) { in main()
219 mappages = roundup(mapsize, pagesize) / pagesize; in main()
223 for (j = 0; j < pagesize; j++) in main()
398 paddr = (uchar_t *) (mapaddr + (randpage * pagesize)); in child_mapper()
400 for (i = procno; i < pagesize; i += nprocs) { in child_mapper()
423 paddr = (uchar_t *) mapaddr + (randpage * pagesize); in child_mapper()
424 if (msync((caddr_t) paddr, (mappages - randpage) * pagesize, in child_mapper()
[all …]
Dmmapstress08.c65 long pagesize = sysconf(_SC_PAGE_SIZE); in main() local
71 if (sbrk(pagesize - ((u_long) sbrk(0) % (u_long) pagesize)) == in main()
87 if (mmap(mmapaddr, pagesize, PROT_READ | PROT_WRITE, in main()
93 mmapaddr += NPTEPG * pagesize; in main()
Dmmapstress06.c65 size_t pagesize = sysconf(_SC_PAGE_SIZE); in main() local
79 if (sbrk(pagesize - ((ulong) sbrk(0) & (pagesize - 1))) == (char *)-1) { in main()
89 (mmapaddr, (ANON_GRAN_PAGES_MAX * NMFPTEPG + 1) * pagesize, in main()
/third_party/ltp/testcases/kernel/mem/vma/
Dvma04.c58 static unsigned long pagesize; variable
128 addr = SAFE_MMAP(cleanup, NULL, pagesize * 8, PROT_NONE, in init()
130 SAFE_MMAP(cleanup, addr + pagesize, pagesize * 6, in init()
134 mmap_addr = addr + pagesize; in init()
135 memset(mmap_addr, 0, pagesize * 6); in init()
142 addr = mmap_addr - pagesize; in fin()
143 SAFE_MUNMAP(cleanup, addr, pagesize * 8); in fin()
150 if (mbind(mmap_addr + pagesize * index, pagesize * len, in mem_bind()
163 if (mbind(mmap_addr + pagesize * index, pagesize * len, in mem_interleave()
176 if (mbind(mmap_addr + pagesize * index, pagesize * len, in mem_unbind()
[all …]
Dvma02.c54 static unsigned long pagesize; variable
72 pagesize = getpagesize(); in main()
88 addr = mmap(NULL, pagesize * 3, PROT_WRITE, in main()
95 memset(addr, 0, pagesize * 3); in main()
98 err = mbind(addr + pagesize, pagesize, MPOL_BIND, nmask->maskp, in main()
109 err = mbind(addr, pagesize * 3, MPOL_DEFAULT, NULL, 0, 0); in main()
126 if (end == addr + pagesize * 3) { in main()
143 if (end == addr + pagesize * 3) { in main()
149 if (end != addr + pagesize * 3) in main()
155 if (munmap(addr, pagesize * 3) == -1) in main()
/third_party/ltp/testcases/kernel/syscalls/mremap/
Dmremap05.c118 static int pagesize; variable
164 t->old_address = get_test_area(t->old_size * pagesize, 0); in setup0()
165 t->new_address = get_test_area(t->new_size * pagesize, 1); in setup0()
170 t->old_address = get_test_area(t->old_size * pagesize, 0); in setup1()
171 t->new_address = get_test_area((t->new_size + 1) * pagesize, 1) + 1; in setup1()
176 t->old_address = get_test_area(t->old_size * pagesize, 0); in setup2()
182 t->old_address = get_test_area(t->old_size * pagesize, 0); in setup3()
183 t->new_address = get_test_area(t->new_size * pagesize, 1); in setup3()
190 t->old_address = get_test_area(t->old_size * pagesize, 0); in setup4()
191 t->new_address = get_test_area(t->new_size * pagesize, 0); in setup4()
[all …]
/third_party/ltp/testcases/kernel/controllers/cpuset/cpuset_memory_pressure_test/
Dcpuset_memory_pressure.c48 long int pagesize = getpagesize(); in main() local
49 long int mmap_block = use * unit / 10 / pagesize; in main()
52 while (pagesize * mmap_block > 2 * unit) { in main()
53 unsigned long *addr = mmap(NULL, pagesize * mmap_block, in main()
60 memset(addr, 0xF7, pagesize * mmap_block); in main()
62 if (total_block * pagesize >= use * unit) in main()
/third_party/ltp/testcases/kernel/syscalls/msync/
Dmsync04.c19 static long pagesize; variable
30 index = (addr / pagesize) * sizeof(uint64_t); in get_dirty_bit()
53 mmaped_area = SAFE_MMAP(NULL, pagesize, PROT_READ | PROT_WRITE, in test_msync()
63 if (msync(mmaped_area, pagesize, MS_SYNC) < 0) { in test_msync()
75 SAFE_MUNMAP(mmaped_area, pagesize); in test_msync()
81 pagesize = (off_t)SAFE_SYSCONF(_SC_PAGESIZE); in setup()
87 SAFE_MUNMAP(mmaped_area, pagesize); in cleanup()
/third_party/abseil-cpp/absl/base/internal/
Ddirect_mmap.h82 static int pagesize = 0; in DirectMmap() local
83 if (pagesize == 0) { in DirectMmap()
85 pagesize = getpagesize(); in DirectMmap()
87 pagesize = sysconf(_SC_PAGESIZE); in DirectMmap()
90 if (offset < 0 || offset % pagesize != 0) { in DirectMmap()
97 return __mmap2(start, length, prot, flags, fd, offset / pagesize); in DirectMmap()
101 static_cast<off_t>(offset / pagesize))); in DirectMmap()
/third_party/skia/third_party/externals/abseil-cpp/absl/base/internal/
Ddirect_mmap.h85 static int pagesize = 0; in DirectMmap() local
86 if (pagesize == 0) { in DirectMmap()
88 pagesize = getpagesize(); in DirectMmap()
90 pagesize = sysconf(_SC_PAGESIZE); in DirectMmap()
93 if (offset < 0 || offset % pagesize != 0) { in DirectMmap()
100 return __mmap2(start, length, prot, flags, fd, offset / pagesize); in DirectMmap()
104 static_cast<off_t>(offset / pagesize))); in DirectMmap()
/third_party/selinux/libselinux/src/
Dsestatus.c282 long pagesize; in selinux_status_open() local
294 pagesize = sysconf(_SC_PAGESIZE); in selinux_status_open()
295 if (pagesize < 0) in selinux_status_open()
303 selinux_status = mmap(NULL, pagesize, PROT_READ, MAP_SHARED, fd, 0); in selinux_status_open()
368 long pagesize; in selinux_status_close() local
386 pagesize = sysconf(_SC_PAGESIZE); in selinux_status_close()
388 if (pagesize > 0) in selinux_status_close()
389 munmap(selinux_status, pagesize); in selinux_status_close()
/third_party/ltp/testcases/kernel/syscalls/madvise/
Dmadvise02.c53 static long pagesize; variable
141 pagesize = getpagesize(); in setup()
144 for (i = 0; i < (pagesize / 2); i++) in setup()
158 tmp_addr = (void*)LTP_ALIGN((long)ptr_addr, pagesize); in setup()
161 SAFE_MUNMAP(file2 + st.st_size - pagesize, pagesize); in setup()
196 SAFE_MUNMAP(file2, st.st_size - pagesize); in cleanup()
/third_party/toybox/toys/other/
Dmkswap.c25 int fd = xopen(*toys.optargs, O_RDWR), pagesize = sysconf(_SC_PAGE_SIZE); local
27 unsigned int pages = (len/pagesize)-1, *swap = (unsigned int *)toybuf;
39 xlseek(fd, pagesize-10, SEEK_SET);
48 pages*(unsigned long)(pagesize/1024),
/third_party/ltp/testcases/commands/mkswap/
Dmkswap01.sh50 local pagesize=$op_arg
52 local pagesize=$PAGE_SIZE
66 if [ $pagesize -ne $PAGE_SIZE ]; then
87 local filesize=$((swapsize-pagesize/1024))
96 [ $diff -ne $((filesize-pagesize/1024)) ]; then
/third_party/ltp/testcases/kernel/syscalls/mincore/
Dmincore01.c48 static int pagesize; variable
146 tc->len = as_lim.rlim_cur - (rlim_t)global_pointer + pagesize; in setup4()
161 pagesize = getpagesize(); in setup()
170 global_len = pagesize * 2; in setup()
186 (global_len + pagesize - 1) / pagesize); in setup()
/third_party/ltp/testcases/kernel/controllers/memcg/stress/
Dmemcg_process_stress.c35 int pagesize; in sigusr_handler() local
37 pagesize = getpagesize(); in sigusr_handler()
39 nr_page = ceil((double)memsize / pagesize); in sigusr_handler()
46 pages[i] = mmap(NULL, pagesize, PROT_WRITE | PROT_READ, in sigusr_handler()
/third_party/harfbuzz/test/api/
Dtest-blob.c119 uintptr_t pagesize = (uintptr_t) -1; in get_pagesize() local
122 pagesize = (uintptr_t) sysconf (_SC_PAGE_SIZE); in get_pagesize()
124 pagesize = (uintptr_t) sysconf (_SC_PAGESIZE); in get_pagesize()
126 pagesize = (uintptr_t) getpagesize (); in get_pagesize()
129 g_assert (pagesize != (uintptr_t) -1); in get_pagesize()
131 return pagesize; in get_pagesize()
175 uintptr_t pagesize = get_pagesize (); in fixture_init() local
177 data = mmap (NULL, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); in fixture_init()
180 mprotect ((char *) data, pagesize, PROT_READ); in fixture_init()
/third_party/flutter/skia/third_party/externals/harfbuzz/test/api/
Dtest-blob.c119 uintptr_t pagesize = (uintptr_t) -1; in get_pagesize() local
122 pagesize = (uintptr_t) sysconf (_SC_PAGE_SIZE); in get_pagesize()
124 pagesize = (uintptr_t) sysconf (_SC_PAGESIZE); in get_pagesize()
126 pagesize = (uintptr_t) getpagesize (); in get_pagesize()
129 g_assert (pagesize != (uintptr_t) -1); in get_pagesize()
131 return pagesize; in get_pagesize()
175 uintptr_t pagesize = get_pagesize (); in fixture_init() local
177 data = mmap (NULL, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); in fixture_init()
180 mprotect ((char *) data, pagesize, PROT_READ); in fixture_init()
/third_party/skia/third_party/externals/harfbuzz/test/api/
Dtest-blob.c119 uintptr_t pagesize = (uintptr_t) -1; in get_pagesize() local
122 pagesize = (uintptr_t) sysconf (_SC_PAGE_SIZE); in get_pagesize()
124 pagesize = (uintptr_t) sysconf (_SC_PAGESIZE); in get_pagesize()
126 pagesize = (uintptr_t) getpagesize (); in get_pagesize()
129 g_assert (pagesize != (uintptr_t) -1); in get_pagesize()
131 return pagesize; in get_pagesize()
175 uintptr_t pagesize = get_pagesize (); in fixture_init() local
177 data = mmap (NULL, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); in fixture_init()
180 mprotect ((char *) data, pagesize, PROT_READ); in fixture_init()

1234