Skip to content

Commit 95135e8

Browse files
Xianting Tiankernel-patches-bot
Xianting Tian
authored andcommitted
bpf: Avoid allocing memory on memoryless numa node
In architecture like powerpc, we can have cpus without any local memory attached to it. In such cases the node does not have real memory. Use local_memory_node(), which is guaranteed to have memory. local_memory_node is a noop in other architectures that does not support memoryless nodes. Signed-off-by: Xianting Tian <[email protected]>
1 parent 25fed9b commit 95135e8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/bpf/cpumap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ __cpu_map_entry_alloc(struct bpf_cpumap_val *value, u32 cpu, int map_id)
420420
struct xdp_bulk_queue *bq;
421421

422422
/* Have map->numa_node, but choose node of redirect target CPU */
423-
numa = cpu_to_node(cpu);
423+
numa = local_memory_node(cpu_to_node(cpu));
424424

425425
rcpu = kzalloc_node(sizeof(*rcpu), gfp, numa);
426426
if (!rcpu)

0 commit comments

Comments
 (0)