We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3ad126a commit 242b34fCopy full SHA for 242b34f
arch/loongarch/mm/mmap.c
@@ -3,6 +3,7 @@
3
* Copyright (C) 2020-2022 Loongson Technology Corporation Limited
4
*/
5
#include <linux/export.h>
6
+#include <linux/hugetlb.h>
7
#include <linux/io.h>
8
#include <linux/kfence.h>
9
#include <linux/memblock.h>
@@ -63,8 +64,11 @@ static unsigned long arch_get_unmapped_area_common(struct file *filp,
63
64
}
65
66
info.length = len;
- info.align_mask = do_color_align ? (PAGE_MASK & SHM_ALIGN_MASK) : 0;
67
info.align_offset = pgoff << PAGE_SHIFT;
68
+ if (filp && is_file_hugepages(filp))
69
+ info.align_mask = huge_page_mask_align(filp);
70
+ else
71
+ info.align_mask = do_color_align ? (PAGE_MASK & SHM_ALIGN_MASK) : 0;
72
73
if (dir == DOWN) {
74
info.flags = VM_UNMAPPED_AREA_TOPDOWN;
0 commit comments