]> www.infradead.org Git - users/jedix/linux-maple.git/commit
openvswitch: Allocate struct ovs_pcpu_storage dynamically
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Fri, 13 Jun 2025 12:36:29 +0000 (14:36 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 17 Jun 2025 12:47:46 +0000 (14:47 +0200)
commit7b4ac12cc929e281cf7edc22203e0533790ebc2b
treede612ee06076bc570fce889c76fb83ea893520f2
parent1224b218a4b9203656ecc932152f4c81a97b4fcc
openvswitch: Allocate struct ovs_pcpu_storage dynamically

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 the module 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.

Allocate ovs_pcpu_storage dynamically at module init time.

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>
Reviewed-by: Aaron Conole <aconole@redhat.com>
Link: https://patch.msgid.link/20250613123629.-XSoQTCu@linutronix.de
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/openvswitch/actions.c
net/openvswitch/datapath.c
net/openvswitch/datapath.h