Re: [LTP] [PATCH 7/8] Hugetlb: Migrating libhugetlbfs misalign

Richard Palethorpe
2022-12-12T14:33:17Z

Tarun Sahu <tsahu@linux.ibm.com> writes:

> Migrating the libhugetlbfs/testcases/misalign.c test
>
> Test Description: Just as normal mmap()s can't have an address, length or
> offset which is not page aligned, so hugepage mmap()s can't have an
> address, length or offset with is not hugepage aligned.
>
> However, from time to time when the various mmap() /
> get_unmapped_area() paths are updated, somebody misses one of the
> necessary checks for the hugepage paths. This testcase ensures
> that attempted hugepage mappings with parameters which are not
> correctly hugepage aligned are rejected.
>
> However starting with 3.10-rc1, length passed in mmap() doesn't need
> to be aligned because 'commit af73e4d9506d
> ("hugetlbfs: fix mmap failure in unaligned size request")' added ALIGN()
> to kernel side, in mmap_pgoff(), when mapping huge page files.
>
> Signed-off-by: Tarun Sahu <tsahu@linux.ibm.com>
Reviewed-by: Richard Palethorpe <rpalethorpe@suse.com>

--
Thank you,
Richard.