Lines Matching defs:alloc_size
119 * With allocated memory chunk [p, p + alloc_size), this
124 * The memory region size alloc_size is within the rlimit.
132 static void test_mlock_within_limit(char *p, int alloc_size)
141 if (cur.rlim_cur < alloc_size)
142 ksft_exit_fail_msg("alloc_size[%d] < %u rlimit,lead to mlock failure\n",
143 alloc_size, (unsigned int)cur.rlim_cur);
149 * - choose lock_size randomly but lock_size < alloc_size
151 * < p+alloc_size
154 int lock_size = rand() % alloc_size;
155 int start_offset = rand() % (alloc_size - lock_size);
166 p, alloc_size,
176 if (locked_vm_size > PAGE_ALIGN(alloc_size, page_size) + page_size)
178 __func__, locked_vm_size, alloc_size);
187 * With allocated memory chunk [p, p + alloc_size), this
191 * The memory region size alloc_size is above the rlimit.
199 static void test_mlock_outof_limit(char *p, int alloc_size)
207 if (cur.rlim_cur >= alloc_size)
208 ksft_exit_fail_msg("alloc_size[%d] >%u rlimit, violates test condition\n",
209 alloc_size, (unsigned int)cur.rlim_cur);
215 int lock_size = (rand() % (alloc_size - cur.rlim_cur))
217 int start_offset = rand() % (alloc_size - lock_size);
227 p, alloc_size, p + start_offset, lock_size);