linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: percpu: Increase PERCPU_MODULE_RESERVE
@ 2025-06-11 16:18 Sebastian Andrzej Siewior
  2025-06-11 17:45 ` Tejun Heo
  0 siblings, 1 reply; 6+ messages in thread
From: Sebastian Andrzej Siewior @ 2025-06-11 16:18 UTC (permalink / raw)
  To: linux-mm
  Cc: Dennis Zhou, Tejun Heo, Christoph Lameter, Gal Pressman,
	Peter Zijlstra, Thomas Gleixner

PERCPU_MODULE_RESERVE defines the maximum size that can by used for the
per-CPU data size used by modules. This is 8KiB.

Commit 035fcdc4d240c ("openvswitch: Merge three per-CPU structures into
one") restructured the per-CPU memory allocation for openvswitch and
moved the separate alloc_percpu() invocations at module init time to a
static per-CPU variable which is allocated by the module loader.

The size of the per-CPU data section for openvswitch is 6488 bytes which
is ~80% of the available per-CPU memory. Together with a few other
modules it is easy to exhaust the available 8KiB of memory.

The memory range for the per-CPU memory is allocated early and pages for
its backing are only allocated once the per-CPU memory is allocated.
Increasing the map from 8 to 16 KiB adds 256 bytes to the alloc_map and
bound_map and 64 bytes to md_blocks (576 bytes in total).

Increase the available memory for module's per-CPU data section to
16KiB.

Reported-by: Gal Pressman <gal@nvidia.com>
Closes: https://lore.kernel.org/all/c401e017-f8db-4f57-a1cd-89beb979a277@nvidia.com
Fixes: 035fcdc4d240c ("openvswitch: Merge three per-CPU structures into one")
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 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 85bf8dd9f0874..57fcca09de18e 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -15,7 +15,7 @@
 
 /* enough to cover all DEFINE_PER_CPUs in modules */
 #ifdef CONFIG_MODULES
-#define PERCPU_MODULE_RESERVE		(8 << 10)
+#define PERCPU_MODULE_RESERVE		(8 << 11)
 #else
 #define PERCPU_MODULE_RESERVE		0
 #endif
-- 
2.49.0



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

end of thread, other threads:[~2025-06-11 20:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-11 16:18 [PATCH] mm: percpu: Increase PERCPU_MODULE_RESERVE Sebastian Andrzej Siewior
2025-06-11 17:45 ` Tejun Heo
2025-06-11 18:32   ` Sebastian Andrzej Siewior
2025-06-11 18:37     ` Tejun Heo
2025-06-11 19:06       ` Sebastian Andrzej Siewior
2025-06-11 20:35         ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).