diff options
-rw-r--r-- | kernel/trace/ring_buffer.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index bbf51922a8ca..384ca5d9d729 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c | |||
@@ -577,8 +577,17 @@ struct ring_buffer *ring_buffer_alloc(unsigned long size, unsigned flags) | |||
577 | if (buffer->pages == 1) | 577 | if (buffer->pages == 1) |
578 | buffer->pages++; | 578 | buffer->pages++; |
579 | 579 | ||
580 | /* | ||
581 | * In case of non-hotplug cpu, if the ring-buffer is allocated | ||
582 | * in early initcall, it will not be notified of secondary cpus. | ||
583 | * In that off case, we need to allocate for all possible cpus. | ||
584 | */ | ||
585 | #ifdef CONFIG_HOTPLUG_CPU | ||
580 | get_online_cpus(); | 586 | get_online_cpus(); |
581 | cpumask_copy(buffer->cpumask, cpu_online_mask); | 587 | cpumask_copy(buffer->cpumask, cpu_online_mask); |
588 | #else | ||
589 | cpumask_copy(buffer->cpumask, cpu_possible_mask); | ||
590 | #endif | ||
582 | buffer->cpus = nr_cpu_ids; | 591 | buffer->cpus = nr_cpu_ids; |
583 | 592 | ||
584 | bsize = sizeof(void *) * nr_cpu_ids; | 593 | bsize = sizeof(void *) * nr_cpu_ids; |