[lkml]   [2019]   [Aug]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] modules: page-align module section allocations only for arches supporting strict module rwx
From: He Zhe <>

We should keep the case of "#define debug_align(X) (X)" for all arches
without CONFIG_HAS_STRICT_MODULE_RWX ability, which would save people, who
are sensitive to system size, a lot of memory when using modules,
especially for embedded systems. This is also the intention of the
original #ifdef... statement and still valid for now.

Note that this still keeps the effect of the fix of the following commit,
38f054d549a8 ("modules: always page-align module section allocations"),
since when CONFIG_ARCH_HAS_STRICT_MODULE_RWX is enabled, module pages are

Signed-off-by: He Zhe <>
This patch is based on the top of modules-next tree, 38f054d549a8.

kernel/module.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/kernel/module.c b/kernel/module.c
index cd8df51..9ee9342 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -64,9 +64,14 @@

* Modules' sections will be aligned on page boundaries
- * to ensure complete separation of code and data
+ * to ensure complete separation of code and data, but
# define debug_align(X) ALIGN(X, PAGE_SIZE)
+# define debug_align(X) (X)

/* If this is set, the section belongs in the init part of the module */
 \ /
  Last update: 2019-08-20 16:54    [W:0.055 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site