Skip to content

Commit 7e1f4ef

Browse files
Yang Shigregkh
Yang Shi
authored andcommitted
mm: huge_memory: use !CONFIG_64BIT to relax huge page alignment on 32 bit machines
commit d959202 upstream. Yves-Alexis Perez reported commit 4ef9ad1 ("mm: huge_memory: don't force huge page alignment on 32 bit") didn't work for x86_32 [1]. It is because x86_32 uses CONFIG_X86_32 instead of CONFIG_32BIT. !CONFIG_64BIT should cover all 32 bit machines. [1] https://lore.kernel.org/linux-mm/CAHbLzkr1LwH3pcTgM+aGQ31ip2bKqiqEQ8=FQB+t2c3dhNKNHA@mail.gmail.com/ Link: https://lkml.kernel.org/r/[email protected] Fixes: 4ef9ad1 ("mm: huge_memory: don't force huge page alignment on 32 bit") Signed-off-by: Yang Shi <[email protected]> Reported-by: Yves-Alexis Perez <[email protected]> Tested-by: Yves-Alexis Perez <[email protected]> Acked-by: David Hildenbrand <[email protected]> Cc: Ben Hutchings <[email protected]> Cc: Christoph Lameter <[email protected]> Cc: Jiri Slaby <[email protected]> Cc: Matthew Wilcox (Oracle) <[email protected]> Cc: Rik van Riel <[email protected]> Cc: Salvatore Bonaccorso <[email protected]> Cc: Suren Baghdasaryan <[email protected]> Cc: <[email protected]> [6.8+] Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent b14cc2c commit 7e1f4ef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/huge_memory.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ static unsigned long __thp_get_unmapped_area(struct file *filp,
857857
loff_t off_align = round_up(off, size);
858858
unsigned long len_pad, ret, off_sub;
859859

860-
if (IS_ENABLED(CONFIG_32BIT) || in_compat_syscall())
860+
if (!IS_ENABLED(CONFIG_64BIT) || in_compat_syscall())
861861
return 0;
862862

863863
if (off_end <= off_align || (off_end - off_align) < size)

0 commit comments

Comments
 (0)