linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* mm: percpu: increase PERCPU_MODULE_RESERVE to avoid allocation failure
@ 2025-04-22 11:39 gaoxu
  2025-04-23  0:02 ` Andrew Morton
  0 siblings, 1 reply; 6+ messages in thread
From: gaoxu @ 2025-04-22 11:39 UTC (permalink / raw)
  To: Andrew Morton, Dennis Zhou, Tejun Heo, Christoph Lameter
  Cc: linux-mm, linux-kernel, surenb, yipengxiang, gaoxu

In android16-6.12, enabling CONFIG_MEM_ALLOC_PROFILING causes some modules
to fail to load during boot because of failed percpu memory allocation.

[811:modprobe]percpu: allocation failed, size=5200 align=8 atomic=0, alloc
from reserved chunk failed
[811:modprobe]Call trace:
[811:modprobe] dump_backtrace+0xfc/0x17c
[811:modprobe] show_stack+0x18/0x28
[811:modprobe] dump_stack_lvl+0x40/0xc0
[811:modprobe] dump_stack+0x18/0x24
[811:modprobe] pcpu_alloc_noprof+0x96c/0xb58
[811:modprobe] percpu_modalloc+0x50/0xec
[811:modprobe] load_module+0x1158/0x153c
[811:modprobe] __arm64_sys_finit_module+0x23c/0x340
[811:modprobe] invoke_syscall+0x58/0x10c
[811:modprobe] el0_svc_common+0xa8/0xdc
[811:modprobe] do_el0_svc+0x1c/0x28
[811:modprobe] el0_svc+0x40/0x90
[811:modprobe] el0t_64_sync_handler+0x70/0xbc
[811:modprobe] el0t_64_sync+0x1a8/0x1ac
[811:modprobe]ipam: Could not allocate 5200 bytes percpu data

Increase PERCPU_MODULE_RESERVE to resolve this issue.

Signed-off-by: gao xu <gaoxu2@honor.com>
---
 include/linux/percpu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index 52b5ea663..765c7f562 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -16,7 +16,7 @@
 /* enough to cover all DEFINE_PER_CPUs in modules */
 #ifdef CONFIG_MODULES
 #ifdef CONFIG_MEM_ALLOC_PROFILING
-#define PERCPU_MODULE_RESERVE		(8 << 13)
+#define PERCPU_MODULE_RESERVE		(8 << 14)
 #else
 #define PERCPU_MODULE_RESERVE		(8 << 10)
 #endif
-- 
2.17.1

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-04-23 17:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-22 11:39 mm: percpu: increase PERCPU_MODULE_RESERVE to avoid allocation failure gaoxu
2025-04-23  0:02 ` Andrew Morton
2025-04-23  0:19   ` Suren Baghdasaryan
2025-04-23 15:12     ` Tejun Heo
2025-04-23 17:04       ` Suren Baghdasaryan
2025-04-23  1:17   ` Dennis Zhou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox