Skip to content

Commit

Permalink
stress-mmaptorture: add remap_file_pages call where available
Browse files Browse the repository at this point in the history
Signed-off-by: Colin Ian King <[email protected]>
  • Loading branch information
ColinIanKing committed Feb 17, 2025
1 parent dc41f30 commit 27e9c4b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion stress-mmaptorture.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,14 @@ static int stress_mmaptorture_child(stress_args_t *args, void *context)
volatile uint8_t *vptr = (volatile uint8_t *)(mmap_data + offset);

(*vptr)++;
stress_mmaptorture_msync(mmap_data, MMAP_PAGES_MAX * page_size, page_size);
stress_mmaptorture_msync(mmap_data, MMAP_PAGES_MAX * page_size, page_size);
}
}
#if defined(HAVE_REMAP_FILE_PAGES) && \
!defined(STRESS_ARCH_SPARC)
(void)remap_file_pages(mmap_data, MMAP_PAGES_MAX * page_size, PROT_NONE, 0, MAP_SHARED | MAP_NONBLOCK);
(void)mprotect(mmap_data, MMAP_PAGES_MAX * page_size, PROT_READ | PROT_WRITE);
#endif

for (n = 0; n < MMAP_MAX; n++) {
int flag = 0;
Expand Down

0 comments on commit 27e9c4b

Please sign in to comment.