Home
last modified time | relevance | path

Searched refs:gopts (Results 1 – 5 of 5) sorted by relevance

/linux/tools/testing/selftests/mm/
H A Duffd-stress.c52 static uffd_global_test_opts_t *gopts; variable
85 static void uffd_stats_reset(uffd_global_test_opts_t *gopts, struct uffd_args *args, in uffd_stats_reset() argument
92 args[i].apply_wp = gopts->test_uffdio_wp; in uffd_stats_reset()
96 args[i].gopts = gopts; in uffd_stats_reset()
103 uffd_global_test_opts_t *gopts = args->gopts; in locking_thread() local
111 page_nr += cpu * gopts->nr_pages_per_cpu; in locking_thread()
114 while (!gopts->finished) { in locking_thread()
120 page_nr %= gopts->nr_pages; in locking_thread()
121 pthread_mutex_lock(area_mutex(gopts->area_dst, page_nr, gopts)); in locking_thread()
122 count = *area_count(gopts->area_dst, page_nr, gopts); in locking_thread()
[all …]
H A Duffd-unit-tests.c213 uffd_global_test_opts_t *gopts; member
222 args->gopts->ready_for_fork = true; in fork_event_consumer()
225 while (uffd_read_msg(args->gopts, &msg)); in fork_event_consumer()
281 static int pagemap_test_fork(uffd_global_test_opts_t *gopts, bool with_event, bool test_pin) in pagemap_test_fork() argument
283 fork_event_args args = { .gopts = gopts, .child_uffd = -1 }; in pagemap_test_fork()
291 gopts->ready_for_fork = false; in pagemap_test_fork()
294 while (!gopts->ready_for_fork) in pagemap_test_fork()
305 if (test_pin && pin_pages(&args, gopts->area_dst, gopts->page_size)) in pagemap_test_fork()
312 value = pagemap_get_entry(fd, gopts->area_dst); in pagemap_test_fork()
338 static void uffd_wp_unpopulated_test(uffd_global_test_opts_t *gopts, uffd_test_args_t *args) in uffd_wp_unpopulated_test() argument
[all …]
H A Duffd-common.c15 pthread_mutex_t *area_mutex(char *area, unsigned long nr, uffd_global_test_opts_t *gopts) in area_mutex() argument
17 return (pthread_mutex_t *) (area + nr * gopts->page_size); in area_mutex()
25 uffd_global_test_opts_t *gopts) in area_count() argument
28 ((unsigned long)(area + nr * gopts->page_size + in area_count()
53 static void anon_release_pages(uffd_global_test_opts_t *gopts, char *rel_area) in anon_release_pages() argument
55 if (madvise(rel_area, gopts->nr_pages * gopts->page_size, MADV_DONTNEED)) in anon_release_pages()
59 static int anon_allocate_area(uffd_global_test_opts_t *gopts, void **alloc_area, bool is_src) in anon_allocate_area() argument
61 *alloc_area = mmap(NULL, gopts->nr_pages * gopts->page_size, PROT_READ | PROT_WRITE, in anon_allocate_area()
70 static void noop_alias_mapping(uffd_global_test_opts_t *gopts, __u64 *start, in noop_alias_mapping() argument
75 static void hugetlb_release_pages(uffd_global_test_opts_t *gopts, char *rel_area) in hugetlb_release_pages() argument
[all …]
H A Duffd-common.h79 struct uffd_global_test_opts *gopts; member
82 void (*handle_fault)(struct uffd_global_test_opts *gopts,
88 int (*allocate_area)(uffd_global_test_opts_t *gopts, void **alloc_area, bool is_src);
89 void (*release_pages)(uffd_global_test_opts_t *gopts, char *rel_area);
90 void (*alias_mapping)(uffd_global_test_opts_t *gopts,
94 void (*check_pmd_mapping)(uffd_global_test_opts_t *gopts, void *p, int expect_nr_hpages);
99 int (*pre_alloc)(uffd_global_test_opts_t *gopts, const char **errmsg);
100 int (*post_alloc)(uffd_global_test_opts_t *gopts, const char **errmsg);
111 pthread_mutex_t *area_mutex(char *area, unsigned long nr, uffd_global_test_opts_t *gopts);
114 uffd_global_test_opts_t *gopts);
[all …]
H A Duffd-wp-mremap.c155 static void test_one_folio(uffd_global_test_opts_t *gopts, size_t size, bool private, in test_one_folio() argument
180 if (userfaultfd_open(gopts, &features)) { in test_one_folio()
187 if (uffd_register(gopts->uffd, mem, size, false, true, false)) { in test_one_folio()
194 if (ioctl(gopts->uffd, UFFDIO_WRITEPROTECT, &wp_prms)) { in test_one_folio()
241 if (gopts->uffd >= 0) { in test_one_folio()
242 close(gopts->uffd); in test_one_folio()
243 gopts->uffd = -1; in test_one_folio()
335 uffd_global_test_opts_t gopts = { 0 }; in main() local
367 test_one_folio(&gopts, tc->sizes[j], tc->private, in main()