Commit 870d4b12 authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds

mm: percpu: use pr_fmt to prefix output

Use the normal mechanism to make the logging output consistently
"percpu:" instead of a mix of "PERCPU:" and "percpu:"
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Acked-by: default avatarTejun Heo <tj@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 1170532b
...@@ -95,7 +95,7 @@ static int __init pcpu_verify_alloc_info(const struct pcpu_alloc_info *ai) ...@@ -95,7 +95,7 @@ static int __init pcpu_verify_alloc_info(const struct pcpu_alloc_info *ai)
/* all units must be in a single group */ /* all units must be in a single group */
if (ai->nr_groups != 1) { if (ai->nr_groups != 1) {
pr_crit("percpu: can't handle more than one groups\n"); pr_crit("can't handle more than one group\n");
return -EINVAL; return -EINVAL;
} }
...@@ -103,7 +103,7 @@ static int __init pcpu_verify_alloc_info(const struct pcpu_alloc_info *ai) ...@@ -103,7 +103,7 @@ static int __init pcpu_verify_alloc_info(const struct pcpu_alloc_info *ai)
alloc_pages = roundup_pow_of_two(nr_pages); alloc_pages = roundup_pow_of_two(nr_pages);
if (alloc_pages > nr_pages) if (alloc_pages > nr_pages)
pr_warn("percpu: wasting %zu pages per chunk\n", pr_warn("wasting %zu pages per chunk\n",
alloc_pages - nr_pages); alloc_pages - nr_pages);
return 0; return 0;
......
...@@ -53,6 +53,8 @@ ...@@ -53,6 +53,8 @@
* setup the first chunk containing the kernel static percpu area * setup the first chunk containing the kernel static percpu area
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/bitmap.h> #include <linux/bitmap.h>
#include <linux/bootmem.h> #include <linux/bootmem.h>
#include <linux/err.h> #include <linux/err.h>
...@@ -1033,11 +1035,11 @@ static void __percpu *pcpu_alloc(size_t size, size_t align, bool reserved, ...@@ -1033,11 +1035,11 @@ static void __percpu *pcpu_alloc(size_t size, size_t align, bool reserved,
spin_unlock_irqrestore(&pcpu_lock, flags); spin_unlock_irqrestore(&pcpu_lock, flags);
fail: fail:
if (!is_atomic && warn_limit) { if (!is_atomic && warn_limit) {
pr_warn("PERCPU: allocation failed, size=%zu align=%zu atomic=%d, %s\n", pr_warn("allocation failed, size=%zu align=%zu atomic=%d, %s\n",
size, align, is_atomic, err); size, align, is_atomic, err);
dump_stack(); dump_stack();
if (!--warn_limit) if (!--warn_limit)
pr_info("PERCPU: limit reached, disable warning\n"); pr_info("limit reached, disable warning\n");
} }
if (is_atomic) { if (is_atomic) {
/* see the flag handling in pcpu_blance_workfn() */ /* see the flag handling in pcpu_blance_workfn() */
...@@ -1538,8 +1540,8 @@ int __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai, ...@@ -1538,8 +1540,8 @@ int __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai,
#define PCPU_SETUP_BUG_ON(cond) do { \ #define PCPU_SETUP_BUG_ON(cond) do { \
if (unlikely(cond)) { \ if (unlikely(cond)) { \
pr_emerg("PERCPU: failed to initialize, %s", #cond); \ pr_emerg("failed to initialize, %s\n", #cond); \
pr_emerg("PERCPU: cpu_possible_mask=%*pb\n", \ pr_emerg("cpu_possible_mask=%*pb\n", \
cpumask_pr_args(cpu_possible_mask)); \ cpumask_pr_args(cpu_possible_mask)); \
pcpu_dump_alloc_info(KERN_EMERG, ai); \ pcpu_dump_alloc_info(KERN_EMERG, ai); \
BUG(); \ BUG(); \
...@@ -1723,7 +1725,7 @@ static int __init percpu_alloc_setup(char *str) ...@@ -1723,7 +1725,7 @@ static int __init percpu_alloc_setup(char *str)
pcpu_chosen_fc = PCPU_FC_PAGE; pcpu_chosen_fc = PCPU_FC_PAGE;
#endif #endif
else else
pr_warn("PERCPU: unknown allocator %s specified\n", str); pr_warn("unknown allocator %s specified\n", str);
return 0; return 0;
} }
...@@ -2016,7 +2018,7 @@ int __init pcpu_embed_first_chunk(size_t reserved_size, size_t dyn_size, ...@@ -2016,7 +2018,7 @@ int __init pcpu_embed_first_chunk(size_t reserved_size, size_t dyn_size,
/* warn if maximum distance is further than 75% of vmalloc space */ /* warn if maximum distance is further than 75% of vmalloc space */
if (max_distance > VMALLOC_TOTAL * 3 / 4) { if (max_distance > VMALLOC_TOTAL * 3 / 4) {
pr_warn("PERCPU: max_distance=0x%zx too large for vmalloc space 0x%lx\n", pr_warn("max_distance=0x%zx too large for vmalloc space 0x%lx\n",
max_distance, VMALLOC_TOTAL); max_distance, VMALLOC_TOTAL);
#ifdef CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK #ifdef CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK
/* and fail if we have fallback */ /* and fail if we have fallback */
...@@ -2025,7 +2027,7 @@ int __init pcpu_embed_first_chunk(size_t reserved_size, size_t dyn_size, ...@@ -2025,7 +2027,7 @@ int __init pcpu_embed_first_chunk(size_t reserved_size, size_t dyn_size,
#endif #endif
} }
pr_info("PERCPU: Embedded %zu pages/cpu @%p s%zu r%zu d%zu u%zu\n", pr_info("Embedded %zu pages/cpu @%p s%zu r%zu d%zu u%zu\n",
PFN_DOWN(size_sum), base, ai->static_size, ai->reserved_size, PFN_DOWN(size_sum), base, ai->static_size, ai->reserved_size,
ai->dyn_size, ai->unit_size); ai->dyn_size, ai->unit_size);
...@@ -2099,7 +2101,7 @@ int __init pcpu_page_first_chunk(size_t reserved_size, ...@@ -2099,7 +2101,7 @@ int __init pcpu_page_first_chunk(size_t reserved_size,
ptr = alloc_fn(cpu, PAGE_SIZE, PAGE_SIZE); ptr = alloc_fn(cpu, PAGE_SIZE, PAGE_SIZE);
if (!ptr) { if (!ptr) {
pr_warn("PERCPU: failed to allocate %s page for cpu%u\n", pr_warn("failed to allocate %s page for cpu%u\n",
psize_str, cpu); psize_str, cpu);
goto enomem; goto enomem;
} }
...@@ -2139,7 +2141,7 @@ int __init pcpu_page_first_chunk(size_t reserved_size, ...@@ -2139,7 +2141,7 @@ int __init pcpu_page_first_chunk(size_t reserved_size,
} }
/* we're ready, commit */ /* we're ready, commit */
pr_info("PERCPU: %d %s pages/cpu @%p s%zu r%zu d%zu\n", pr_info("%d %s pages/cpu @%p s%zu r%zu d%zu\n",
unit_pages, psize_str, vm.addr, ai->static_size, unit_pages, psize_str, vm.addr, ai->static_size,
ai->reserved_size, ai->dyn_size); ai->reserved_size, ai->dyn_size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment