Message ID | 20211009092658.59665-4-rongwei.wang@linux.alibaba.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | mm, thp: introduce a new sysfs interface to facilitate file THP for .text | expand |
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index a813b70f594e..78795572d877 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -1136,6 +1136,11 @@ static int load_elf_binary(struct linux_binprm *bprm) retval = -EINVAL; goto out_free_dentry; } +#ifdef CONFIG_HUGETEXT + if (hugetext_enabled() && interpreter && + total_size >= HPAGE_PMD_SIZE) + load_bias &= HPAGE_PMD_MASK; +#endif } error = elf_map(bprm->file, load_bias + vaddr, elf_ppnt,