diff options
author | Fangrui Song <maskray@google.com> | 2023-12-20 06:41:23 +0100 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2023-12-29 20:58:42 +0100 |
commit | 7fbb5e188248c50f737720825da1864ce42536d1 (patch) | |
tree | 1a079634bcdd3a308a8e54eafed7abbf865d21f3 | |
parent | mm/khugepaged: remove redundant try_to_freeze() (diff) | |
download | linux-7fbb5e188248c50f737720825da1864ce42536d1.tar.xz linux-7fbb5e188248c50f737720825da1864ce42536d1.zip |
mm: remove VM_EXEC requirement for THP eligibility
Commit e6be37b2e7bd ("mm/huge_memory.c: add missing read-only THP checking
in transparent_hugepage_enabled()") introduced the VM_EXEC requirement,
which is not strictly needed.
lld's default --rosegment option and GNU ld's -z separate-code option
(default on Linux/x86 since binutils 2.31) create a read-only PT_LOAD
segment without the PF_X flag, which should be eligible for THP.
Certain architectures support medium and large code models, where .lrodata
may be placed in a separate read-only PT_LOAD segment, which should be
eligible for THP as well.
Link: https://lkml.kernel.org/r/20231220054123.1266001-1-maskray@google.com
Signed-off-by: Fangrui Song <maskray@google.com>
Acked-by: Yang Shi <shy828301@gmail.com>
Cc: Miaohe Lin <linmiaohe@huawei.com>
Cc: Song Liu <songliubraving@fb.com>
Cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-rw-r--r-- | include/linux/huge_mm.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index fa7a38a30fc6..5adb86af35fc 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h @@ -206,7 +206,6 @@ static inline bool file_thp_enabled(struct vm_area_struct *vma) inode = vma->vm_file->f_inode; return (IS_ENABLED(CONFIG_READ_ONLY_THP_FOR_FS)) && - (vma->vm_flags & VM_EXEC) && !inode_is_open_for_write(inode) && S_ISREG(inode->i_mode); } |