Skip to content

Commit

Permalink
stress-mmap: touching pages should be using sz and not context->mmap_…
Browse files Browse the repository at this point in the history
…bytes

An incorrect size is being used to touch pages, use sz as this is the correct
size.

Signed-off-by: Colin Ian King <[email protected]>
  • Loading branch information
ColinIanKing committed Jan 17, 2024
1 parent 4f13cb8 commit 8538c17
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stress-mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ static int stress_mmap_child(stress_args_t *args, void *ctxt)
(void)stress_madvise_random(buf, sz);
if (context->mmap_mergeable)
(void)stress_madvise_mergeable(buf, sz);
(void)stress_mincore_touch_pages(buf, context->mmap_bytes);
(void)stress_mincore_touch_pages(buf, sz);
stress_mmap_mprotect(args->name, buf, sz, page_size, context->mmap_mprotect);
for (n = 0; n < pages; n++) {
mapped[n] = PAGE_MAPPED;
Expand Down Expand Up @@ -626,7 +626,7 @@ static int stress_mmap_child(stress_args_t *args, void *ctxt)
}
}

(void)stress_mincore_touch_pages(buf, context->mmap_bytes);
(void)stress_mincore_touch_pages(buf, sz);

/*
* Step #1, set random ordered page advise and protection
Expand Down

0 comments on commit 8538c17

Please sign in to comment.