diff options
Diffstat (limited to 'kernel/profile.c')
-rw-r--r-- | kernel/profile.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/kernel/profile.c b/kernel/profile.c index a55d3a367ae8..b22a899934cc 100644 --- a/kernel/profile.c +++ b/kernel/profile.c | |||
@@ -127,8 +127,10 @@ int __ref profile_init(void) | |||
127 | return 0; | 127 | return 0; |
128 | 128 | ||
129 | prof_buffer = vmalloc(buffer_bytes); | 129 | prof_buffer = vmalloc(buffer_bytes); |
130 | if (prof_buffer) | 130 | if (prof_buffer) { |
131 | memset(prof_buffer, 0, buffer_bytes); | ||
131 | return 0; | 132 | return 0; |
133 | } | ||
132 | 134 | ||
133 | free_cpumask_var(prof_cpu_mask); | 135 | free_cpumask_var(prof_cpu_mask); |
134 | return -ENOMEM; | 136 | return -ENOMEM; |
@@ -363,14 +365,14 @@ static int __cpuinit profile_cpu_callback(struct notifier_block *info, | |||
363 | switch (action) { | 365 | switch (action) { |
364 | case CPU_UP_PREPARE: | 366 | case CPU_UP_PREPARE: |
365 | case CPU_UP_PREPARE_FROZEN: | 367 | case CPU_UP_PREPARE_FROZEN: |
366 | node = cpu_to_node(cpu); | 368 | node = cpu_to_mem(cpu); |
367 | per_cpu(cpu_profile_flip, cpu) = 0; | 369 | per_cpu(cpu_profile_flip, cpu) = 0; |
368 | if (!per_cpu(cpu_profile_hits, cpu)[1]) { | 370 | if (!per_cpu(cpu_profile_hits, cpu)[1]) { |
369 | page = alloc_pages_exact_node(node, | 371 | page = alloc_pages_exact_node(node, |
370 | GFP_KERNEL | __GFP_ZERO, | 372 | GFP_KERNEL | __GFP_ZERO, |
371 | 0); | 373 | 0); |
372 | if (!page) | 374 | if (!page) |
373 | return NOTIFY_BAD; | 375 | return notifier_from_errno(-ENOMEM); |
374 | per_cpu(cpu_profile_hits, cpu)[1] = page_address(page); | 376 | per_cpu(cpu_profile_hits, cpu)[1] = page_address(page); |
375 | } | 377 | } |
376 | if (!per_cpu(cpu_profile_hits, cpu)[0]) { | 378 | if (!per_cpu(cpu_profile_hits, cpu)[0]) { |
@@ -386,7 +388,7 @@ out_free: | |||
386 | page = virt_to_page(per_cpu(cpu_profile_hits, cpu)[1]); | 388 | page = virt_to_page(per_cpu(cpu_profile_hits, cpu)[1]); |
387 | per_cpu(cpu_profile_hits, cpu)[1] = NULL; | 389 | per_cpu(cpu_profile_hits, cpu)[1] = NULL; |
388 | __free_page(page); | 390 | __free_page(page); |
389 | return NOTIFY_BAD; | 391 | return notifier_from_errno(-ENOMEM); |
390 | case CPU_ONLINE: | 392 | case CPU_ONLINE: |
391 | case CPU_ONLINE_FROZEN: | 393 | case CPU_ONLINE_FROZEN: |
392 | if (prof_cpu_mask != NULL) | 394 | if (prof_cpu_mask != NULL) |
@@ -565,7 +567,7 @@ static int create_hash_tables(void) | |||
565 | int cpu; | 567 | int cpu; |
566 | 568 | ||
567 | for_each_online_cpu(cpu) { | 569 | for_each_online_cpu(cpu) { |
568 | int node = cpu_to_node(cpu); | 570 | int node = cpu_to_mem(cpu); |
569 | struct page *page; | 571 | struct page *page; |
570 | 572 | ||
571 | page = alloc_pages_exact_node(node, | 573 | page = alloc_pages_exact_node(node, |