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/20210923164741.1859522-4-bigeasy@linutronix.de Link: https://lore.kernel.org/r/20210830172627.267989-4-bigeasy@linutronix.de Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Acked-by: Dmitry Vyukov <dvyukov@google.com> Acked-by: Marco Elver <elver@google.com> Tested-by: Marco Elver <elver@google.com> Reviewed-by: Andrey Konovalov <andreyknvl@gmail.com> Cc: Clark Williams <williams@redhat.com> Cc: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 6f1d34b commit 741ddd4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

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)