Skip to content
Commit e255b1c8 authored by Ryan Roberts's avatar Ryan Roberts
Browse files

selftests/mm: ksm_tests should only MADV_HUGEPAGE valid memory



ksm_tests was previously mmapping a region of memory, aligning the
returned pointer to a PMD boundary, then setting MADV_HUGEPAGE, but was
setting it past the end of the mmapped area due to not taking the
pointer alignment into consideration. Fix this behaviour.

Up until commit efa7df3e ("mm: align larger anonymous mappings on
THP boundaries"), this buggy behavior was (usually) masked because the
alignment difference was always less than PMD-size. But since the
mentioned commit, `ksm_tests -H -s 100` started failing.

Fixes: 32525489 ("selftests: vm: add KSM huge pages merging time test")
Cc: stable@vger.kernel.org
Signed-off-by: Ryan Roberts's avatarRyan Roberts <ryan.roberts@arm.com>
parent 0b0f3e54
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment