Home
last modified time | relevance | path

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

12345

/external/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 …]
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 …]
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()
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()
88 if (mmap(mmapaddr, pagesize, PROT_READ | PROT_WRITE, in main()
94 mmapaddr += NPTEPG * pagesize; in main()
/external/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()
/external/strace/tests/
Dioctl_uffdio.c55 size_t pagesize = getpagesize(); in main() local
92 void *area1 = mmap(NULL, pagesize, PROT_READ|PROT_WRITE, in main()
97 void *area2 = mmap(NULL, pagesize, PROT_READ|PROT_WRITE, in main()
102 madvise(area2, pagesize, MADV_DONTNEED); in main()
119 register_struct->range.len = pagesize; in main()
125 fd, area2, pagesize); in main()
151 copy_struct->len = pagesize; in main()
156 fd, area2, area1, pagesize, pagesize, rc); in main()
160 madvise(area2, pagesize, MADV_DONTNEED); in main()
172 zero_struct->range.len = pagesize; in main()
[all …]
Dmmap.c40 const intmax_t pagesize = get_page_size(); in main() local
41 const unsigned long length1 = pagesize * 6; in main()
42 const unsigned long length2 = pagesize * 3; in main()
43 const unsigned long length3 = pagesize * 2; in main()
49 offset = 0xcafedeadbeef000ULL & -pagesize; in main()
50 addr = (void *) (uintmax_t) (0xfacefeed000 & -pagesize); in main()
52 offset = 0xdeadbeef000ULL & -pagesize; in main()
53 addr = (void *) (unsigned int) (0xfaced000 & -pagesize); in main()
/external/strace/tests-m32/
Dioctl_uffdio.c55 size_t pagesize = getpagesize(); in main() local
92 void *area1 = mmap(NULL, pagesize, PROT_READ|PROT_WRITE, in main()
97 void *area2 = mmap(NULL, pagesize, PROT_READ|PROT_WRITE, in main()
102 madvise(area2, pagesize, MADV_DONTNEED); in main()
119 register_struct->range.len = pagesize; in main()
125 fd, area2, pagesize); in main()
151 copy_struct->len = pagesize; in main()
156 fd, area2, area1, pagesize, pagesize, rc); in main()
160 madvise(area2, pagesize, MADV_DONTNEED); in main()
172 zero_struct->range.len = pagesize; in main()
[all …]
Dmmap.c40 const intmax_t pagesize = get_page_size(); in main() local
41 const unsigned long length1 = pagesize * 6; in main()
42 const unsigned long length2 = pagesize * 3; in main()
43 const unsigned long length3 = pagesize * 2; in main()
49 offset = 0xcafedeadbeef000ULL & -pagesize; in main()
50 addr = (void *) (uintmax_t) (0xfacefeed000 & -pagesize); in main()
52 offset = 0xdeadbeef000ULL & -pagesize; in main()
53 addr = (void *) (unsigned int) (0xfaced000 & -pagesize); in main()
/external/strace/tests-mx32/
Dioctl_uffdio.c55 size_t pagesize = getpagesize(); in main() local
92 void *area1 = mmap(NULL, pagesize, PROT_READ|PROT_WRITE, in main()
97 void *area2 = mmap(NULL, pagesize, PROT_READ|PROT_WRITE, in main()
102 madvise(area2, pagesize, MADV_DONTNEED); in main()
119 register_struct->range.len = pagesize; in main()
125 fd, area2, pagesize); in main()
151 copy_struct->len = pagesize; in main()
156 fd, area2, area1, pagesize, pagesize, rc); in main()
160 madvise(area2, pagesize, MADV_DONTNEED); in main()
172 zero_struct->range.len = pagesize; in main()
[all …]
Dmmap.c40 const intmax_t pagesize = get_page_size(); in main() local
41 const unsigned long length1 = pagesize * 6; in main()
42 const unsigned long length2 = pagesize * 3; in main()
43 const unsigned long length3 = pagesize * 2; in main()
49 offset = 0xcafedeadbeef000ULL & -pagesize; in main()
50 addr = (void *) (uintmax_t) (0xfacefeed000 & -pagesize); in main()
52 offset = 0xdeadbeef000ULL & -pagesize; in main()
53 addr = (void *) (unsigned int) (0xfaced000 & -pagesize); in main()
/external/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 …]
/external/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()
/external/autotest/client/tests/rmaptest/src/
Drmap-test.c27 int pagesize; variable
74 p[page * pagesize]++; in touch_pages()
85 msync(p, vmasize * pagesize, MS_ASYNC); in msync_file()
104 p = vma_addresses[rand_vma] + rand_page * pagesize; in touch_random_pages()
188 pagesize = getpagesize(); in main()
194 file_size *= pagesize; in main()
198 ((long long)nvmas * vmasize * pagesize) / 1024); in main()
221 p = mmap(0, vmasize * pagesize, PROT_READ|PROT_WRITE, in main()
228 offset += vmasize * pagesize + pagesize; in main()
/external/ltp/testcases/kernel/syscalls/msync/
Dmsync04.c31 static long pagesize; variable
42 index = (addr / pagesize) * sizeof(uint64_t); in get_dirty_bit()
64 mmaped_area = SAFE_MMAP(NULL, pagesize, PROT_READ | PROT_WRITE, in test_msync()
74 if (msync(mmaped_area, pagesize, MS_SYNC) < 0) { in test_msync()
86 SAFE_MUNMAP(mmaped_area, pagesize); in test_msync()
92 pagesize = (off_t)SAFE_SYSCONF(_SC_PAGESIZE); in setup()
98 SAFE_MUNMAP(mmaped_area, pagesize); in cleanup()
/external/selinux/libselinux/src/
Dsestatus.c259 long pagesize; in selinux_status_open() local
266 pagesize = sysconf(_SC_PAGESIZE); in selinux_status_open()
267 if (pagesize < 0) in selinux_status_open()
275 selinux_status = mmap(NULL, pagesize, PROT_READ, MAP_SHARED, fd, 0); in selinux_status_open()
325 long pagesize; in selinux_status_close() local
340 pagesize = sysconf(_SC_PAGESIZE); in selinux_status_close()
342 if (pagesize > 0) in selinux_status_close()
343 munmap(selinux_status, pagesize); in selinux_status_close()
/external/ltp/testcases/kernel/syscalls/madvise/
Dmadvise02.c59 static long pagesize; variable
129 pagesize = getpagesize(); in setup()
132 for (i = 0; i < (pagesize / 2); i++) in setup()
139 SAFE_MUNMAP(file2 + st.st_size - pagesize, pagesize); in setup()
144 tmp_addr = (void*)LTP_ALIGN((long)ptr_addr, pagesize); in setup()
179 SAFE_MUNMAP(file2, st.st_size - pagesize); in cleanup()
/external/valgrind/memcheck/tests/
Ddescr_belowsp.c83 const int pagesize = getpagesize(); in guess_pagesize() local
85 const int pagesize = 4096; // let's say ? in guess_pagesize()
87 return pagesize; in guess_pagesize()
92 const int pagesize = guess_pagesize(); in describe_many() local
96 (void*) VG_ROUNDUP(lowest_j, pagesize)); in describe_many()
98 (void*) VG_ROUNDUP(lowest_j, pagesize)-1); in describe_many()
100 (void*) VG_ROUNDDN(lowest_j, pagesize)); in describe_many()
/external/valgrind/none/tests/
Dmap_unmap.c44 static unsigned int pagesize; variable
47 #define LEN (PAGES*pagesize)
67 off = (random() % LEN) & ~(pagesize-1); in nibblemap()
71 munmap((char *)p + off, pagesize); in nibblemap()
72 off += 619*pagesize; in nibblemap()
90 pagesize = getpagesize(); in main()
/external/harfbuzz_ng/src/
Dhb-blob.cc391 uintptr_t pagesize = -1, mask, length; in _try_make_writable_inplace_unix() local
395 pagesize = (uintptr_t) sysconf (_SC_PAGE_SIZE); in _try_make_writable_inplace_unix()
397 pagesize = (uintptr_t) sysconf (_SC_PAGESIZE); in _try_make_writable_inplace_unix()
399 pagesize = (uintptr_t) getpagesize (); in _try_make_writable_inplace_unix()
402 if ((uintptr_t) -1L == pagesize) { in _try_make_writable_inplace_unix()
406 DEBUG_MSG_FUNC (BLOB, blob, "pagesize is %lu", (unsigned long) pagesize); in _try_make_writable_inplace_unix()
408 mask = ~(pagesize-1); in _try_make_writable_inplace_unix()
410 length = (const char *) (((uintptr_t) blob->data + blob->length + pagesize-1) & mask) - addr; in _try_make_writable_inplace_unix()

12345