Skip to content

Commit 741ddd4

Browse files
Sebastian Andrzej Siewiortorvalds
authored andcommitted
kcov: allocate per-CPU memory on the relevant node
During boot kcov allocates per-CPU memory which is used later if remote/ softirq processing is enabled. Allocate the per-CPU memory on the CPU local node to avoid cross node memory access. Link: https://lkml.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Acked-by: Dmitry Vyukov <[email protected]> Acked-by: Marco Elver <[email protected]> Tested-by: Marco Elver <[email protected]> Reviewed-by: Andrey Konovalov <[email protected]> Cc: Clark Williams <[email protected]> Cc: Steven Rostedt <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 6f1d34b commit 741ddd4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/kcov.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,8 +1034,8 @@ static int __init kcov_init(void)
10341034
int cpu;
10351035

10361036
for_each_possible_cpu(cpu) {
1037-
void *area = vmalloc(CONFIG_KCOV_IRQ_AREA_SIZE *
1038-
sizeof(unsigned long));
1037+
void *area = vmalloc_node(CONFIG_KCOV_IRQ_AREA_SIZE *
1038+
sizeof(unsigned long), cpu_to_node(cpu));
10391039
if (!area)
10401040
return -ENOMEM;
10411041
per_cpu_ptr(&kcov_percpu_data, cpu)->irq_area = area;

0 commit comments

Comments
 (0)