Re: [PATCH] mm: huge_memory: don't force huge page alignment on 32 bit

From: Jiri Slaby
Date: Fri Jan 26 2024 - 05:19:01 EST


On 26. 01. 24, 10:36, Jiri Slaby wrote:
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -37,6 +37,7 @@
  #include <linux/page_owner.h>
  #include <linux/sched/sysctl.h>
  #include <linux/memory-tiers.h>
+#include <linux/compat.h>
  #include <asm/tlb.h>
  #include <asm/pgalloc.h>
@@ -811,6 +812,14 @@ static unsigned long __thp_get_unmapped_area(struct file *filp,
      loff_t off_align = round_up(off, size);
      unsigned long len_pad, ret;
+    /*
+     * It doesn't make too much sense to froce huge page alignment on
+     * 32 bit system or compat userspace due to the contrained virtual
+     * address space and address entropy.
+     */

FWIW,
Bernhard noticed that "froce" and "contrained", could you fix that before applying the patch?

No, you can't:

1) it was merged to mm-stable already, and
2) the comment is not in that version at all [1]

[1] https://lore.kernel.org/all/20240126075612.87780C433F1@xxxxxxxxxxxxxxx/

thanks,

--
js
suse labs