Skip to content

Commit 7fbb5e1

Browse files
MaskRayakpm00
authored andcommitted
mm: remove VM_EXEC requirement for THP eligibility
Commit e6be37b ("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/[email protected] Signed-off-by: Fangrui Song <[email protected]> Acked-by: Yang Shi <[email protected]> Cc: Miaohe Lin <[email protected]> Cc: Song Liu <[email protected]> Cc: Matthew Wilcox <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent b39ca20 commit 7fbb5e1

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

include/linux/huge_mm.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,6 @@ static inline bool file_thp_enabled(struct vm_area_struct *vma)
206206
inode = vma->vm_file->f_inode;
207207

208208
return (IS_ENABLED(CONFIG_READ_ONLY_THP_FOR_FS)) &&
209-
(vma->vm_flags & VM_EXEC) &&
210209
!inode_is_open_for_write(inode) && S_ISREG(inode->i_mode);
211210
}
212211

0 commit comments

Comments
 (0)