On Wed, 15 Nov 2017, Kirill A. Shutemov wrote: > On Wed, Nov 15, 2017 at 05:04:26PM +0300, Kirill A. Shutemov wrote: > /* requesting a specific address */ > if (addr) { > - addr = PAGE_ALIGN(addr); > + addr &= PAGE_MASK; > if (!mmap_address_hint_valid(addr, len)) > goto get_unmapped_area; > > diff --git a/arch/x86/mm/hugetlbpage.c b/arch/x86/mm/hugetlbpage.c > index 92db903c3dad..00b296617ca4 100644 > --- a/arch/x86/mm/hugetlbpage.c > +++ b/arch/x86/mm/hugetlbpage.c > @@ -166,7 +166,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr, > } > > if (addr) { > - addr = ALIGN(addr, huge_page_size(h)); > + addr &= huge_page_mask(h); > if (!mmap_address_hint_valid(addr, len)) > goto get_unmapped_area; That should work. Care to pickup my variant, make the fixups and resend along with the selftest which covers both normal and huge mappings? Thanks, tglx -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>