Re: [Bug 56881] New: MAP_HUGETLB mmap fails for certain sizes
From: Aneesh Kumar K.V <hidden>
Date: 2013-06-18 11:15:07
Andrew Morton [off-list ref] writes:
On Wed, 12 Jun 2013 17:46:16 +0530 "Aneesh Kumar K.V" [off-list ref] wrote:quoted
quoted
From: Naoya Horiguchi <redacted> Date: Wed, 24 Apr 2013 16:44:19 -0400 Subject: [PATCH] hugetlbfs: fix mmap failure in unaligned size request As reported in https://bugzilla.kernel.org/show_bug.cgi?id=56881, current kernel returns -EINVAL unless a given mmap length is "almost" hugepage aligned. This is because in sys_mmap_pgoff() the given length is passed to vm_mmap_pgoff() as it is without being aligned with hugepage boundary. This is a regression introduced in commit 40716e29243d "hugetlbfs: fix alignment of huge page requests", where alignment code is pushed into hugetlb_file_setup() and the variable len in caller side is not changed. To fix this, this patch partially reverts that commit, and changes the type of parameter size from size_t to (size_t *) in order to align the size in caller side.After the change af73e4d9506d3b797509f3c030e7dcd554f7d9c4 we have alignment related failures in libhugetlbfs test suite. misalign test fails with 3.10-rc5, while it works with 3.9.What does this mean. Is 3.10-rc5 more strict, or less strict? If "less strict" then that's expected and old userspace should be OK with the change and the test should be updated (sorry).
3.10_rc5 is less strict. Also Naoya Horiguchi updated that relevant changes to libhugetlbfs test is also posted at http://www.mail-archive.com/libhugetlbfs-devel@lists.sourceforge.net/msg13317.html -aneesh -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>