mm: Make the logging a bit more consistent
Subsystems (20)
cover mm: Make the logging a bit more consistent
Joe Perches (4):
mm: Convert pr_warning to pr_warn
mm: Coalesce split strings
mm: Convert printk(KERN_<LEVEL> to pr_<level>
mm: percpu: Use pr_fmt to prefix output
mm/backing-dev.c | 4 +-- mm/bootmem.c | 7 ++--- mm/dmapool.c | 18 +++++------- mm/huge_memory.c | 3 +- mm/hugetlb.c | 9 +++--- mm/internal.h | 2 +- mm/kasan/report.c | 6 ++-- mm/kmemcheck.c | 3 +- mm/kmemleak-test.c | 2 +- mm/kmemleak.c | 32 ++++++++++----------- mm/memblock.c | 3 +- mm/memory-failure.c | 52 ++++++++++++++-------------------- mm/memory.c | 17 +++++------ mm/memory_hotplug.c | 14 ++++----- mm/mempolicy.c | 4 +-- mm/mm_init.c | 7 ++--- mm/mmap.c | 8 ++---- mm/nobootmem.c | 4 +-- mm/oom_kill.c | 3 +- mm/page_alloc.c | 59 +++++++++++++++++--------------------- mm/page_io.c | 22 +++++++-------- mm/page_owner.c | 5 ++-- mm/page_poison.c | 4 +-- mm/percpu-km.c | 6 ++-- mm/percpu.c | 43 ++++++++++++++-------------- mm/shmem.c | 14 ++++----- mm/slab.c | 81 ++++++++++++++++++++++------------------------------- mm/slab_common.c | 12 ++++---- mm/slub.c | 19 ++++++------- mm/sparse-vmemmap.c | 8 +++--- mm/sparse.c | 21 ++++++-------- mm/swap_cgroup.c | 5 ++-- mm/swapfile.c | 3 +- mm/vmalloc.c | 4 +-- 34 files changed, 219 insertions(+), 285 deletions(-)
Signature · 7 lines
2.6.3.368.gf34be46 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
PATCH 1/4 mm: Convert pr_warning to pr_warn
There are a mixture of pr_warning and pr_warn uses in mm. Use pr_warn consistently.
Miscellanea:
o Coalesce formats
o Realign arguments
--- mm/hugetlb.c | 9 ++++----- mm/kmemleak.c | 14 +++++++------- mm/percpu.c | 15 +++++++-------- 3 files changed, 18 insertions(+), 20 deletions(-)
mm/hugetlb.c +4 -5
@@ -2665,7 +2665,7 @@ void __init hugetlb_add_hstate(unsigned int order)unsigned long i;if (size_to_hstate (PAGE_SIZE << order)) { -pr_warning ("hugepagesz= specified twice, ignoring\n" ); +pr_warn ("hugepagesz= specified twice, ignoring\n" );return ; }BUG_ON (hugetlb_max_hstate >=HUGE_MAX_HSTATE );
@@ -2701,8 +2701,7 @@ static int __init hugetlb_nrpages_setup(char *s) mhp = &parsed_hstate->max_huge_pages;if (mhp == last_mhp) { -pr_warning ("hugepages= specified twice without " -"interleaving hugepagesz=, ignoring\n" ); +pr_warn ("hugepages= specified twice without interleaving hugepagesz=, ignoring\n" );return 1 ; }
@@ -3502,8 +3501,8 @@ static int hugetlb_no_page(struct mm_struct *mm, struct vm_area_struct *vma,* COW. Warn that such a situation has occurred as it may not be obvious */ if (is_vma_resv_set (vma,HPAGE_RESV_UNMAPPED )) { -pr_warning ("PID %d killed due to inadequate hugepage pool\n" , - current->pid); +pr_warn ("PID %d killed due to inadequate hugepage pool\n" , + current->pid);return ret; }
mm/kmemleak.c +7 -7
@@ -276,7 +276,7 @@ static void kmemleak_disable(void);* Print a warning and dump the stack trace. */ #define kmemleak_warn(x...) do { \ - pr_warning(x); \ + pr_warn(x); \ dump_stack(); \ kmemleak_warning = 1; \ } while (0)
@@ -543,7 +543,7 @@ static struct kmemleak_object *create_object(unsigned long ptr, size_t size, object =kmem_cache_alloc (object_cache,gfp_kmemleak_mask (gfp));if (!object) { -pr_warning ("Cannot allocate a kmemleak_object structure\n" ); +pr_warn ("Cannot allocate a kmemleak_object structure\n" );kmemleak_disable ();return NULL ; }
@@ -764,7 +764,7 @@ static void add_scan_area(unsigned long ptr, size_t size, gfp_t gfp) area =kmem_cache_alloc (scan_area_cache,gfp_kmemleak_mask (gfp));if (!area) { -pr_warning ("Cannot allocate a scan area\n" ); +pr_warn ("Cannot allocate a scan area\n" ); goto out; }
@@ -1515,7 +1515,7 @@ static void start_scan_thread(void)return ; scan_thread =kthread_run (kmemleak_scan_thread,NULL ,"kmemleak" );if (IS_ERR (scan_thread)) { -pr_warning ("Failed to create the scan thread\n" ); +pr_warn ("Failed to create the scan thread\n" ); scan_thread =NULL ; } }
@@ -1874,8 +1874,8 @@ void __init kmemleak_init(void) scan_area_cache =KMEM_CACHE (kmemleak_scan_area,SLAB_NOLEAKTRACE );if (crt_early_log >ARRAY_SIZE (early_log)) -pr_warning ("Early log buffer exceeded (%d), please increase " -"DEBUG_KMEMLEAK_EARLY_LOG_SIZE\n" , crt_early_log); +pr_warn ("Early log buffer exceeded (%d), please increase DEBUG_KMEMLEAK_EARLY_LOG_SIZE\n" , + crt_early_log);/* the kernel is still in UP mode, so disabling the IRQs is enough */ local_irq_save (flags);
@@ -1960,7 +1960,7 @@ static int __init kmemleak_late_init(void) dentry =debugfs_create_file ("kmemleak" ,S_IRUGO ,NULL ,NULL , &kmemleak_fops);if (!dentry) -pr_warning ("Failed to create the debugfs kmemleak file\n" ); +pr_warn ("Failed to create the debugfs kmemleak file\n" );mutex_lock (&scan_mutex);start_scan_thread ();mutex_unlock (&scan_mutex);
mm/percpu.c +7 -8
@@ -1033,8 +1033,8 @@ fail_unlock:spin_unlock_irqrestore (&pcpu_lock, flags); fail:if (!is_atomic && warn_limit) { -pr_warning ("PERCPU: allocation failed, size=%zu align=%zu atomic=%d, %s\n" , - size, align, is_atomic, err); +pr_warn ("PERCPU: allocation failed, size=%zu align=%zu atomic=%d, %s\n" , + size, align, is_atomic, err);dump_stack ();if (!--warn_limit)pr_info ("PERCPU: limit reached, disable warning\n" );
@@ -1723,7 +1723,7 @@ static int __init percpu_alloc_setup(char *str) pcpu_chosen_fc =PCPU_FC_PAGE ;#endif else - pr_warning("PERCPU: unknown allocator %s specified\n", str); + pr_warn("PERCPU: unknown allocator %s specified\n", str);return 0 ; }
@@ -2016,9 +2016,8 @@ 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 */ if (max_distance >VMALLOC_TOTAL *3 /4 ) { -pr_warning ("PERCPU: max_distance=0x%zx too large for vmalloc " -"space 0x%lx\n" , max_distance, -VMALLOC_TOTAL ); +pr_warn ("PERCPU: max_distance=0x%zx too large for vmalloc space 0x%lx\n" , + max_distance,VMALLOC_TOTAL );#ifdef CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK /* and fail if we have fallback */ rc = -EINVAL ;
@@ -2100,8 +2099,8 @@ int __init pcpu_page_first_chunk(size_t reserved_size, ptr =alloc_fn (cpu,PAGE_SIZE ,PAGE_SIZE );if (!ptr) { -pr_warning ("PERCPU: failed to allocate %s page " -"for cpu%u\n" , psize_str, cpu); +pr_warn ("PERCPU: failed to allocate %s page for cpu%u\n" , + psize_str, cpu); goto enomem; }/* kmemleak tracks the percpu allocations separately */
Signature · 7 lines
2.6.3.368.gf34be46 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH 1/4] mm: Convert pr_warning to pr_warn
Quoted 9 lines · Joe Perches
There are a mixture of
pr_warningandpr_warnuses in mm. Usepr_warnconsistently.Miscellanea:
o Coalesce formats
o Realign argumentsSigned-off-by Joe Perches <[email protected]>
For percpu,
Thanks.
Signature · 7 lines
tejun -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
PATCH 2/4 mm: Coalesce split strings
In reply to Joe PerchesKernel style prefers a single string over split strings when the string is 'user-visible'.
Miscellanea:
o Add a missing newline
o Realign arguments
--- mm/dmapool.c | 10 ++++------ mm/huge_memory.c | 3 +-- mm/kasan/report.c | 6 ++---- mm/kmemcheck.c | 3 +-- mm/kmemleak.c | 18 ++++++++---------- mm/memblock.c | 3 +-- mm/memory_hotplug.c | 3 +-- mm/mempolicy.c | 4 +--- mm/mmap.c | 8 +++----- mm/oom_kill.c | 3 +-- mm/page_alloc.c | 37 +++++++++++++++++-------------------- mm/page_owner.c | 5 ++--- mm/percpu.c | 4 ++-- mm/slab.c | 28 ++++++++++------------------ mm/slab_common.c | 10 ++++------ mm/slub.c | 19 +++++++++---------- mm/sparse-vmemmap.c | 8 ++++---- mm/sparse.c | 8 ++++---- mm/swapfile.c | 3 +-- mm/vmalloc.c | 4 ++-- 20 files changed, 78 insertions(+), 109 deletions(-)
mm/dmapool.c +4 -6
@@ -452,13 +452,11 @@ void dma_pool_free(struct dma_pool *pool, void *vaddr, dma_addr_t dma) }spin_unlock_irqrestore (&pool->lock, flags);if (pool->dev) -dev_err (pool->dev,"dma_pool_free %s, dma %Lx " -"already free\n" , pool->name, - (unsigned long long )dma); +dev_err (pool->dev,"dma_pool_free %s, dma %Lx already free\n" , + pool->name, (unsigned long long )dma);else -printk (KERN_ERR "dma_pool_free %s, dma %Lx " -"already free\n" , pool->name, - (unsigned long long )dma); +printk (KERN_ERR "dma_pool_free %s, dma %Lx already free\n" , + pool->name, (unsigned long long )dma);return ; } }
mm/huge_memory.c +1 -2
@@ -171,8 +171,7 @@ static void set_recommended_min_free_kbytes(void)if (recommended_min > min_free_kbytes) {if (user_min_free_kbytes >=0 ) -pr_info ("raising min_free_kbytes from %d to %lu " -"to help transparent hugepage allocations\n" , +pr_info ("raising min_free_kbytes from %d to %lu to help transparent hugepage allocations\n" , min_free_kbytes, recommended_min); min_free_kbytes = recommended_min;
mm/kasan/report.c +2 -4
@@ -214,8 +214,7 @@ static void kasan_report_error(struct kasan_access_info *info)*/ kasan_disable_current ();spin_lock_irqsave (&report_lock, flags); -pr_err ("=================================" -"=================================\n" ); +pr_err ("==================================================================\n" );if (info->access_addr <kasan_shadow_to_mem ((void *)KASAN_SHADOW_START )) {if ((unsigned long )info->access_addr <PAGE_SIZE )
@@ -236,8 +235,7 @@ static void kasan_report_error(struct kasan_access_info *info)print_address_description (info);print_shadow_for_address (info->first_bad_addr); } -pr_err ("=================================" -"=================================\n" ); +pr_err ("==================================================================\n" );add_taint (TAINT_BAD_PAGE ,LOCKDEP_NOW_UNRELIABLE );spin_unlock_irqrestore (&report_lock, flags);kasan_enable_current ();
mm/kmemcheck.c +1 -2
@@ -20,8 +20,7 @@ void kmemcheck_alloc_shadow(struct page *page, int order, gfp_t flags, int node) shadow =alloc_pages_node (node, flags | __GFP_NOTRACK, order);if (!shadow) {if (printk_ratelimit ()) -printk (KERN_ERR "kmemcheck: failed to allocate " -"shadow bitmap\n" ); +printk (KERN_ERR "kmemcheck: failed to allocate shadow bitmap\n" );return ; }
mm/kmemleak.c +8 -10
@@ -596,8 +596,7 @@ static struct kmemleak_object *create_object(unsigned long ptr, size_t size,else if (parent->pointer + parent->size <= ptr) link = &parent->rb_node.rb_right;else { -kmemleak_stop ("Cannot insert 0x%lx into the object " -"search tree (overlaps existing)\n" , +kmemleak_stop ("Cannot insert 0x%lx into the object search tree (overlaps existing)\n" , ptr);/* * No need for parent->lock here since "parent" cannot
@@ -670,8 +669,8 @@ static void delete_object_part(unsigned long ptr, size_t size) object =find_and_remove_object (ptr,1 );if (!object) {#ifdef DEBUG -kmemleak_warn ("Partially freeing unknown object at 0x%08lx " -"(size %zu)\n" , ptr, size); +kmemleak_warn ("Partially freeing unknown object at 0x%08lx (size %zu)\n" , + ptr, size);#endif return ; }
@@ -717,8 +716,8 @@ static void paint_ptr(unsigned long ptr, int color) object =find_and_get_object (ptr,0 );if (!object) { -kmemleak_warn ("Trying to color unknown object " -"at 0x%08lx as %s\n" , ptr, +kmemleak_warn ("Trying to color unknown object at 0x%08lx as %s\n" , + ptr, (color ==KMEMLEAK_GREY ) ?"Grey" : (color ==KMEMLEAK_BLACK ) ?"Black" :"Unknown" );return ;
@@ -1463,8 +1462,8 @@ static void kmemleak_scan(void)if (new_leaks) { kmemleak_found_leaks = true; -pr_info ("%d new suspected memory leaks (see " -"/sys/kernel/debug/kmemleak)\n" , new_leaks); +pr_info ("%d new suspected memory leaks (see /sys/kernel/debug/kmemleak)\n" , + new_leaks); } }
@@ -1795,8 +1794,7 @@ static void kmemleak_do_cleanup(struct work_struct *work)if (!kmemleak_found_leaks)__kmemleak_do_cleanup ();else -pr_info ("Kmemleak disabled without freeing internal data. " -"Reclaim the memory with \"echo clear > /sys/kernel/debug/kmemleak\"\n" ); +pr_info ("Kmemleak disabled without freeing internal data. Reclaim the memory with \"echo clear > /sys/kernel/debug/kmemleak\".\n" ); } static DECLARE_WORK(cleanup_work, kmemleak_do_cleanup);
mm/memblock.c +1 -2
@@ -238,8 +238,7 @@ phys_addr_t __init_memblock memblock_find_in_range_node(phys_addr_t size,* so we use WARN_ONCE() here to see the stack trace if * fail happens. */ -WARN_ONCE (1 ,"memblock: bottom-up allocation failed, " -"memory hotunplug may be affected\n" ); +WARN_ONCE (1 ,"memblock: bottom-up allocation failed, memory hotunplug may be affected\n" ); } return __memblock_find_range_top_down(start, end, size, align, nid,
mm/memory_hotplug.c +1 -2
@@ -1970,8 +1970,7 @@ static int check_memblock_offlined_cb(struct memory_block *mem, void *arg) beginpa =PFN_PHYS (section_nr_to_pfn (mem->start_section_nr)); endpa =PFN_PHYS (section_nr_to_pfn (mem->end_section_nr +1 ))-1 ; -pr_warn ("removing memory fails, because memory " -"[%pa-%pa] is onlined\n" , +pr_warn ("removing memory fails, because memory [%pa-%pa] is onlined\n" , &beginpa, &endpa); }
mm/mempolicy.c +1 -3
@@ -2559,9 +2559,7 @@ static void __init check_numabalancing_enable(void)set_numabalancing_state (numabalancing_override ==1 );if (num_online_nodes () >1 && !numabalancing_override) { -pr_info ("%s automatic NUMA balancing. " -"Configure with numa_balancing= or the " -"kernel.numa_balancing sysctl" , +pr_info ("%s automatic NUMA balancing. Configure with numa_balancing= or the kernel.numa_balancing sysctl\n" , numabalancing_default ?"Enabling" :"Disabling" );set_numabalancing_state (numabalancing_default); }
mm/mmap.c +3 -5
@@ -2525,9 +2525,8 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,unsigned long ret = -EINVAL ;struct file *file; -pr_warn_once ("%s (%d) uses deprecated remap_file_pages() syscall. " -"See Documentation/vm/remap_file_pages.txt.\n" , - current->comm, current->pid); +pr_warn_once ("%s (%d) uses deprecated remap_file_pages() syscall. See Documentation/vm/remap_file_pages.txt.\n" , + current->comm, current->pid);if (prot)return ret;
@@ -2893,8 +2892,7 @@ bool may_expand_vm(struct mm_struct *mm, vm_flags_t flags, unsigned long npages)if (is_data_mapping (flags) && mm->data_vm + npages >rlimit (RLIMIT_DATA ) >>PAGE_SHIFT ) {if (ignore_rlimit_data) -pr_warn_once ("%s (%d): VmData %lu exceed data ulimit " -"%lu. Will be forbidden soon.\n" , +pr_warn_once ("%s (%d): VmData %lu exceed data ulimit %lu. Will be forbidden soon.\n" , current->comm, current->pid, (mm->data_vm + npages) <<PAGE_SHIFT ,rlimit (RLIMIT_DATA ));
mm/oom_kill.c +1 -2
@@ -391,8 +391,7 @@ static void dump_tasks(struct mem_cgroup *memcg, const nodemask_t *nodemask)static void dump_header (struct oom_control *oc,struct task_struct *p,struct mem_cgroup *memcg) { -pr_warn ("%s invoked oom-killer: gfp_mask=%#x(%pGg), order=%d, " -"oom_score_adj=%hd\n" , +pr_warn ("%s invoked oom-killer: gfp_mask=%#x(%pGg), order=%d, oom_score_adj=%hd\n" , current->comm, oc->gfp_mask, &oc->gfp_mask, oc->order, current->signal->oom_score_adj);
mm/page_alloc.c +17 -20
@@ -4195,8 +4195,7 @@ static int __parse_numa_zonelist_order(char *s) user_zonelist_order =ZONELIST_ORDER_ZONE ; }else {printk (KERN_WARNING -"Ignoring invalid numa_zonelist_order value: " -"%s\n" , s); +"Ignoring invalid numa_zonelist_order value: %s\n" , s);return -EINVAL ; }return 0 ;
@@ -4660,12 +4659,11 @@ void __ref build_all_zonelists(pg_data_t *pgdat, struct zone *zone)else page_group_by_mobility_disabled =0 ; -pr_info ("Built %i zonelists in %s order, mobility grouping %s. " -"Total pages: %ld\n" , - nr_online_nodes, - zonelist_order_name[current_zonelist_order], - page_group_by_mobility_disabled ?"off" :"on" , - vm_total_pages); +pr_info ("Built %i zonelists in %s order, mobility grouping %s. Total pages: %ld\n" , + nr_online_nodes, + zonelist_order_name[current_zonelist_order], + page_group_by_mobility_disabled ?"off" :"on" , + vm_total_pages);#ifdef CONFIG_NUMA pr_info ("Policy zone: %s\n" , zone_names[policy_zone]);#endif
@@ -6263,22 +6261,21 @@ void __init mem_init_print_info(const char *str)#undef adj_init_size -pr_info ("Memory: %luK/%luK available " -"(%luK kernel code, %luK rwdata, %luK rodata, " -"%luK init, %luK bss, %luK reserved, %luK cma-reserved" +pr_info ("Memory: %luK/%luK available (%luK kernel code, %luK rwdata, %luK rodata, %luK init, %luK bss, %luK reserved, %luK cma-reserved" #ifdef CONFIG_HIGHMEM -", %luK highmem" +", %luK highmem" #endif - "%s%s)\n", -nr_free_pages () << (PAGE_SHIFT -10 ), physpages << (PAGE_SHIFT -10 ), - codesize >>10 , datasize >>10 , rosize >>10 , - (init_data_size + init_code_size) >>10 , bss_size >>10 , - (physpages - totalram_pages - totalcma_pages) << (PAGE_SHIFT -10 ), - totalcma_pages << (PAGE_SHIFT -10 ), + "%s%s)\n", +nr_free_pages () << (PAGE_SHIFT -10 ), + physpages << (PAGE_SHIFT -10 ), + codesize >>10 , datasize >>10 , rosize >>10 , + (init_data_size + init_code_size) >>10 , bss_size >>10 , + (physpages - totalram_pages - totalcma_pages) << (PAGE_SHIFT -10 ), + totalcma_pages << (PAGE_SHIFT -10 ), #ifdef CONFIG_HIGHMEM - totalhigh_pages << (PAGE_SHIFT -10 ), + totalhigh_pages << (PAGE_SHIFT -10 ), #endif - str ? ", " : "", str ? str : ""); + str ? ", " : "", str ? str : ""); }/**
mm/page_owner.c +2 -3
@@ -198,9 +198,8 @@ void __dump_page_owner(struct page *page)return ; } -pr_alert ("page allocated via order %u, migratetype %s, " -"gfp_mask %#x(%pGg)\n" , page_ext->order, - migratetype_names[mt], gfp_mask, &gfp_mask); +pr_alert ("page allocated via order %u, migratetype %s, gfp_mask %#x(%pGg)\n" , + page_ext->order, migratetype_names[mt], gfp_mask, &gfp_mask);print_stack_trace (&trace,0 );if (page_ext->last_migrate_reason !=-1 )
mm/percpu.c +2 -2
@@ -888,8 +888,8 @@ static void __percpu *pcpu_alloc(size_t size, size_t align, bool reserved, size =ALIGN (size,2 );if (unlikely (!size || size >PCPU_MIN_UNIT_SIZE || align >PAGE_SIZE )) { -WARN (true,"illegal size (%zu) or align (%zu) for " -"percpu allocation\n" , size, align); +WARN (true,"illegal size (%zu) or align (%zu) for percpu allocation\n" , + size, align);return NULL ; }
mm/slab.c +10 -18
@@ -1565,11 +1565,9 @@ static void dump_line(char *data, int offset, int limit)if (bad_count ==1 ) { error ^=POISON_FREE ;if (!(error & (error -1 ))) { -printk (KERN_ERR "Single bit error detected. Probably " -"bad RAM.\n" ); +printk (KERN_ERR "Single bit error detected. Probably bad RAM.\n" );#ifdef CONFIG_X86 -printk (KERN_ERR "Run memtest86+ or a similar memory " -"test tool.\n" ); +printk (KERN_ERR "Run memtest86+ or a similar memory test tool.\n" );#else printk (KERN_ERR "Run a memory test tool.\n" );#endif
@@ -1692,11 +1690,9 @@ static void slab_destroy_debugcheck(struct kmem_cache *cachep, }if (cachep->flags &SLAB_RED_ZONE ) {if (*dbg_redzone1 (cachep, objp) !=RED_INACTIVE ) -slab_error (cachep,"start of a freed object " -"was overwritten" ); +slab_error (cachep,"start of a freed object was overwritten" );if (*dbg_redzone2 (cachep, objp) !=RED_INACTIVE ) -slab_error (cachep,"end of a freed object " -"was overwritten" ); +slab_error (cachep,"end of a freed object was overwritten" ); } } }
@@ -2397,11 +2393,9 @@ static void cache_init_objs_debug(struct kmem_cache *cachep, struct page *page)if (cachep->flags &SLAB_RED_ZONE ) {if (*dbg_redzone2 (cachep, objp) !=RED_INACTIVE ) -slab_error (cachep,"constructor overwrote the" -" end of an object" ); +slab_error (cachep,"constructor overwrote the end of an object" );if (*dbg_redzone1 (cachep, objp) !=RED_INACTIVE ) -slab_error (cachep,"constructor overwrote the" -" start of an object" ); +slab_error (cachep,"constructor overwrote the start of an object" ); }/* need to poison the objs? */ if (cachep->flags &SLAB_POISON ) {
@@ -2468,8 +2462,8 @@ static void slab_put_obj(struct kmem_cache *cachep,/* Verify double free bug */ for (i = page->active; i < cachep->num; i++) {if (get_free_obj (page, i) == objnr) { -printk (KERN_ERR "slab: double free detected in cache " -"'%s', objp %p\n" , cachep->name, objp); +printk (KERN_ERR "slab: double free detected in cache '%s', objp %p\n" , + cachep->name, objp);BUG (); } }
@@ -2900,8 +2894,7 @@ static void *cache_alloc_debugcheck_after(struct kmem_cache *cachep,if (cachep->flags &SLAB_RED_ZONE ) {if (*dbg_redzone1 (cachep, objp) !=RED_INACTIVE || *dbg_redzone2 (cachep, objp) !=RED_INACTIVE ) { -slab_error (cachep,"double free, or memory outside" -" object was overwritten" ); +slab_error (cachep,"double free, or memory outside object was overwritten" ); printk(KERN_ERR "%p: redzone 1:0x%llx, redzone 2:0x%llx\n", objp, *dbg_redzone1(cachep, objp),
@@ -4027,8 +4020,7 @@ void slabinfo_show_stats(struct seq_file *m, struct kmem_cache *cachep)unsigned long node_frees = cachep->node_frees;unsigned long overflows = cachep->node_overflow; -seq_printf (m," : globalstat %7lu %6lu %5lu %4lu " -"%4lu %4lu %4lu %4lu %4lu" , +seq_printf (m," : globalstat %7lu %6lu %5lu %4lu %4lu %4lu %4lu %4lu %4lu" , allocs, high, grown, reaped, errors, max_freeable, node_allocs, node_frees, overflows);
mm/slab_common.c +4 -6
@@ -726,8 +726,8 @@ void kmem_cache_destroy(struct kmem_cache *s) err =shutdown_cache (s, &release, &need_rcu_barrier);if (err) { -pr_err ("kmem_cache_destroy %s: " -"Slab cache still has objects\n" , s->name); +pr_err ("kmem_cache_destroy %s: Slab cache still has objects\n" , + s->name);dump_stack (); } out_unlock:
@@ -1047,13 +1047,11 @@ static void print_slabinfo_header(struct seq_file *m)#else seq_puts (m,"slabinfo - version: 2.1\n" );#endif -seq_puts (m,"# name <active_objs> <num_objs> <objsize> " -"<objperslab> <pagesperslab>" ); +seq_puts (m,"# name <active_objs> <num_objs> <objsize> <objperslab> <pagesperslab>" );seq_puts (m," : tunables <limit> <batchcount> <sharedfactor>" );seq_puts (m," : slabdata <active_slabs> <num_slabs> <sharedavail>" );#ifdef CONFIG_DEBUG_SLAB -seq_puts (m," : globalstat <listallocs> <maxobjs> <grown> <reaped> " -"<error> <maxfreeable> <nodeallocs> <remotefrees> <alienoverflow>" ); +seq_puts (m," : globalstat <listallocs> <maxobjs> <grown> <reaped> <error> <maxfreeable> <nodeallocs> <remotefrees> <alienoverflow>" );seq_puts (m," : cpustat <allochit> <allocmiss> <freehit> <freemiss>" );#endif seq_putc (m,'\n' );
mm/slub.c +9 -10
@@ -952,14 +952,14 @@ static int on_freelist(struct kmem_cache *s, struct page *page, void *search) max_objects =MAX_OBJS_PER_PAGE ;if (page->objects != max_objects) { -slab_err (s, page,"Wrong number of objects. Found %d but " -"should be %d" , page->objects, max_objects); +slab_err (s, page,"Wrong number of objects. Found %d but should be %d" , + page->objects, max_objects); page->objects = max_objects;slab_fix (s,"Number of objects adjusted." ); }if (page->inuse != page->objects - nr) { -slab_err (s, page,"Wrong object count. Counter is %d but " -"counted were %d" , page->inuse, page->objects - nr); +slab_err (s, page,"Wrong object count. Counter is %d but counted were %d" , + page->inuse, page->objects - nr); page->inuse = page->objects - nr;slab_fix (s,"Object count adjusted." ); }
@@ -1122,8 +1122,8 @@ static inline int free_consistency_checks(struct kmem_cache *s,if (unlikely (s != page->slab_cache)) {if (!PageSlab (page)) { -slab_err (s, page,"Attempt to free object(0x%p) " -"outside of slab" , object); +slab_err (s, page,"Attempt to free object(0x%p) outside of slab" , + object); }else if (!page->slab_cache) {pr_err ("SLUB <none>: no slab for object 0x%p.\n" , object);
@@ -3456,10 +3456,9 @@ static int kmem_cache_open(struct kmem_cache *s, unsigned long flags)free_kmem_cache_nodes (s); error:if (flags &SLAB_PANIC ) -panic ("Cannot create slab %s size=%lu realsize=%u " -"order=%u offset=%u flags=%lx\n" , - s->name, (unsigned long )s->size, s->size, -oo_order (s->oo), s->offset, flags); +panic ("Cannot create slab %s size=%lu realsize=%u order=%u offset=%u flags=%lx\n" , + s->name, (unsigned long )s->size, s->size, +oo_order (s->oo), s->offset, flags);return -EINVAL ; }
mm/sparse-vmemmap.c +4 -4
@@ -166,8 +166,8 @@ void __meminit vmemmap_verify(pte_t *pte, int node,int actual_node =early_pfn_to_nid (pfn);if (node_distance (actual_node, node) >LOCAL_DISTANCE ) -printk (KERN_WARNING "[%lx-%lx] potential offnode " -"page_structs\n" , start, end -1 ); +printk (KERN_WARNING "[%lx-%lx] potential offnode page_structs\n" , + start, end -1 ); }pte_t *__meminit vmemmap_pte_populate (pmd_t *pmd,unsigned long addr,int node)
@@ -292,8 +292,8 @@ void __init sparse_mem_maps_populate_node(struct page **map_map,if (map_map[pnum])continue ; ms =__nr_to_section (pnum); -printk (KERN_ERR "%s: sparsemem memory map backing failed " -"some memory will not be available.\n" , __func__); +printk (KERN_ERR "%s: sparsemem memory map backing failed some memory will not be available.\n" , + __func__); ms->section_mem_map =0 ; }
mm/sparse.c +4 -4
@@ -428,8 +428,8 @@ void __init sparse_mem_maps_populate_node(struct page **map_map,if (map_map[pnum])continue ; ms =__nr_to_section (pnum); -printk (KERN_ERR "%s: sparsemem memory map backing failed " -"some memory will not be available.\n" , __func__); +printk (KERN_ERR "%s: sparsemem memory map backing failed some memory will not be available.\n" , + __func__); ms->section_mem_map =0 ; } }
@@ -456,8 +456,8 @@ static struct page __init *sparse_early_mem_map_alloc(unsigned long pnum)if (map)return map; -printk (KERN_ERR "%s: sparsemem memory map backing failed " -"some memory will not be available.\n" , __func__); +printk (KERN_ERR "%s: sparsemem memory map backing failed some memory will not be available.\n" , + __func__); ms->section_mem_map =0 ;return NULL ; }
mm/swapfile.c +1 -2
@@ -2532,8 +2532,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags) (swap_flags &SWAP_FLAG_PRIO_MASK ) >>SWAP_FLAG_PRIO_SHIFT ;enable_swap_info (p, prio, swap_map, cluster_info, frontswap_map); - pr_info("Adding %uk swap on %s. " - "Priority:%d extents:%d across:%lluk %s%s%s%s%s\n", + pr_info("Adding %uk swap on %s. Priority:%d extents:%d across:%lluk %s%s%s%s%s\n", p->pages<<(PAGE_SHIFT-10), name->name, p->prio, nr_extents, (unsigned long long)span<<(PAGE_SHIFT-10), (p->flags & SWP_SOLIDSTATE) ? "SS" : "",
mm/vmalloc.c +2 -2
@@ -469,8 +469,8 @@ overflow: goto retry; }if (printk_ratelimit ()) -pr_warn ("vmap allocation for size %lu failed: " -"use vmalloc=<size> to increase size.\n" , size); +pr_warn ("vmap allocation for size %lu failed: use vmalloc=<size> to increase size\n" , + size);kfree (va);return ERR_PTR (-EBUSY ); }
Signature · 7 lines
2.6.3.368.gf34be46 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH 2/4] mm: Coalesce split strings
Quoted 9 lines · Joe Perches
Kernel style prefers a single string over split strings when the string is 'user-visible'.
Miscellanea:
o Add a missing newline
o Realign argumentsSigned-off-by Joe Perches <[email protected]>
For percpu,
Thanks.
Signature · 7 lines
tejun -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
PATCH 3/4 mm: Convert printk(KERN_<LEVEL> to pr_<level>
In reply to Joe PerchesMost of the mm subsystem uses pr_<level> so make it consistent.
Miscellanea:
o Realign arguments
o Add missing newline to format
o kmemleak-test.c has a "kmemleak: " prefix added to the "Kmemleak testing" logging message via pr_fmt
--- mm/backing-dev.c | 4 ++-- mm/bootmem.c | 7 +++---- mm/dmapool.c | 12 +++++------ mm/internal.h | 2 +- mm/kmemcheck.c | 2 +- mm/kmemleak-test.c | 2 +- mm/memory-failure.c | 52 +++++++++++++++++++--------------------------- mm/memory.c | 17 +++++++-------- mm/memory_hotplug.c | 11 +++++----- mm/mm_init.c | 7 +++---- mm/nobootmem.c | 4 ++-- mm/page_alloc.c | 24 ++++++++-------------- mm/page_io.c | 22 ++++++++++---------- mm/page_poison.c | 4 ++-- mm/percpu-km.c | 6 +++--- mm/percpu.c | 12 +++++------ mm/shmem.c | 14 ++++++------- mm/slab.c | 59 ++++++++++++++++++++++++----------------------------- mm/slab_common.c | 2 +- mm/sparse-vmemmap.c | 6 +++--- mm/sparse.c | 17 +++++++-------- mm/swap_cgroup.c | 5 ++--- 22 files changed, 128 insertions(+), 163 deletions(-)
mm/backing-dev.c +2 -2
@@ -1012,8 +1012,8 @@ int pdflush_proc_obsolete(struct ctl_table *table, int write,if (copy_to_user (buffer, kbuf,sizeof (kbuf)))return -EFAULT ; -printk_once (KERN_WARNING "%s exported in /proc is scheduled for removal\n" , - table->procname); +pr_warn_once ("%s exported in /proc is scheduled for removal\n" , + table->procname); *lenp =2 ; *ppos += *lenp;
mm/bootmem.c +3 -4
@@ -50,8 +50,7 @@ early_param("bootmem_debug", bootmem_debug_setup); #define bdebug(fmt, args...) ({ \ if (unlikely(bootmem_debug)) \ - printk(KERN_INFO \ - "bootmem::%s " fmt, \ + pr_info("bootmem::%s " fmt, \ __func__, ## args); \ })
@@ -680,7 +679,7 @@ static void * __init ___alloc_bootmem(unsigned long size, unsigned long align,/* * Whoops, we cannot satisfy the allocation request. */ -printk (KERN_ALERT "bootmem alloc of %lu bytes failed!\n" , size); +pr_alert ("bootmem alloc of %lu bytes failed!\n" , size);panic ("Out of memory" );return NULL ; }
@@ -755,7 +754,7 @@ void * __init ___alloc_bootmem_node(pg_data_t *pgdat, unsigned long size,if (ptr)return ptr; -printk (KERN_ALERT "bootmem alloc of %lu bytes failed!\n" , size); +pr_alert ("bootmem alloc of %lu bytes failed!\n" , size);panic ("Out of memory" );return NULL ; }
mm/dmapool.c +5 -7
@@ -294,8 +294,7 @@ void dma_pool_destroy(struct dma_pool *pool)"dma_pool_destroy %s, %p busy\n" , pool->name, page->vaddr); else - printk(KERN_ERR -"dma_pool_destroy %s, %p busy\n" , + pr_err("dma_pool_destroy %s, %p busy\n", pool->name, page->vaddr);/* leak the still-in-use consistent memory */ list_del (&page->page_list);
@@ -424,7 +423,7 @@ void dma_pool_free(struct dma_pool *pool, void *vaddr, dma_addr_t dma)"dma_pool_free %s, %p/%lx (bad dma)\n" , pool->name, vaddr, (unsigned long)dma); else - printk(KERN_ERR "dma_pool_free %s, %p/%lx (bad dma)\n", + pr_err("dma_pool_free %s, %p/%lx (bad dma)\n", pool->name, vaddr, (unsigned long)dma);return ; }
@@ -438,8 +437,7 @@ void dma_pool_free(struct dma_pool *pool, void *vaddr, dma_addr_t dma)"dma_pool_free %s, %p (bad vaddr)/%Lx\n" , pool->name, vaddr, (unsigned long long)dma); else - printk(KERN_ERR -"dma_pool_free %s, %p (bad vaddr)/%Lx\n" , + pr_err("dma_pool_free %s, %p (bad vaddr)/%Lx\n", pool->name, vaddr, (unsigned long long)dma);return ; }
@@ -455,8 +453,8 @@ void dma_pool_free(struct dma_pool *pool, void *vaddr, dma_addr_t dma)dev_err (pool->dev,"dma_pool_free %s, dma %Lx already free\n" , pool->name, (unsigned long long )dma); else - printk(KERN_ERR "dma_pool_free %s, dma %Lx already free\n", - pool->name, (unsigned long long)dma); + pr_err("dma_pool_free %s, dma %Lx already free\n", + pool->name, (unsigned long long)dma);return ; } }
mm/internal.h +1 -1
@@ -395,7 +395,7 @@ extern int mminit_loglevel; do { \ if (level < mminit_loglevel) { \ if (level <= MMINIT_WARNING) \ - printk(KERN_WARNING "mminit::" prefix " " fmt, ##arg); \ + pr_warn("mminit::" prefix " " fmt, ##arg); \ else \ printk(KERN_DEBUG "mminit::" prefix " " fmt, ##arg); \ } \
mm/kmemcheck.c +1 -1
@@ -20,7 +20,7 @@ void kmemcheck_alloc_shadow(struct page *page, int order, gfp_t flags, int node) shadow =alloc_pages_node (node, flags | __GFP_NOTRACK, order);if (!shadow) {if (printk_ratelimit ()) -printk (KERN_ERR "kmemcheck: failed to allocate shadow bitmap\n" ); +pr_err ("kmemcheck: failed to allocate shadow bitmap\n" );return ; }
mm/kmemleak-test.c +1 -1
@@ -49,7 +49,7 @@ static int __init kmemleak_test_init(void)struct test_node *elem;int i; -printk (KERN_INFO "Kmemleak testing\n" ); +pr_info ("Kmemleak testing\n" );/* make some orphan objects */ pr_info ("kmalloc(32) = %p\n" ,kmalloc (32 ,GFP_KERNEL ));
mm/memory-failure.c +21 -31
142 lines not on this page · raw message
mm/memory.c +7 -10
@@ -661,9 +661,8 @@ static void print_bad_pte(struct vm_area_struct *vma, unsigned long addr,return ; }if (nr_unshown) { -printk (KERN_ALERT -"BUG: Bad page map: %lu messages suppressed\n" , - nr_unshown); +pr_alert ("BUG: Bad page map: %lu messages suppressed\n" , + nr_unshown); nr_unshown =0 ; } nr_shown =0 ;
@@ -674,15 +673,13 @@ static void print_bad_pte(struct vm_area_struct *vma, unsigned long addr, mapping = vma->vm_file ? vma->vm_file->f_mapping :NULL ; index =linear_page_index (vma, addr); -printk (KERN_ALERT -"BUG: Bad page map in process %s pte:%08llx pmd:%08llx\n" , - current->comm, - (long long )pte_val (pte), (long long )pmd_val (*pmd)); +pr_alert ("BUG: Bad page map in process %s pte:%08llx pmd:%08llx\n" , + current->comm, + (long long )pte_val (pte), (long long )pmd_val (*pmd));if (page)dump_page (page,"bad pte" ); -printk (KERN_ALERT -"addr:%p vm_flags:%08lx anon_vma:%p mapping:%p index:%lx\n" , - (void *)addr, vma->vm_flags, vma->anon_vma, mapping, index); +pr_alert ("addr:%p vm_flags:%08lx anon_vma:%p mapping:%p index:%lx\n" , + (void *)addr, vma->vm_flags, vma->anon_vma, mapping, index);/* * Choose text because data symbols depend on CONFIG_KALLSYMS_ALL=y */
mm/memory_hotplug.c +5 -6
@@ -1529,8 +1529,7 @@ do_migrate_range(unsigned long start_pfn, unsigned long end_pfn) }else {#ifdef CONFIG_DEBUG_VM -printk (KERN_ALERT "removing pfn %lx from LRU failed\n" , - pfn); +pr_alert ("removing pfn %lx from LRU failed\n" , pfn);dump_page (page,"failed to remove from LRU" );#endif put_page (page);
@@ -1858,7 +1857,7 @@ repeat: ret = -EBUSY ; goto failed_removal; } -printk (KERN_INFO "Offlined Pages %ld\n" , offlined_pages); +pr_info ("Offlined Pages %ld\n" , offlined_pages);/* Ok, all of our target is isolated. We cannot do rollback at this point. */ offline_isolated_pages (start_pfn, end_pfn);
@@ -1895,9 +1894,9 @@ repeat:return 0 ; failed_removal: -printk (KERN_INFO "memory offlining [mem %#010llx-%#010llx] failed\n" , - (unsigned long long ) start_pfn <<PAGE_SHIFT , - ((unsigned long long ) end_pfn <<PAGE_SHIFT ) -1 ); +pr_info ("memory offlining [mem %#010llx-%#010llx] failed\n" , + (unsigned long long )start_pfn <<PAGE_SHIFT , + ((unsigned long long )end_pfn <<PAGE_SHIFT ) -1 );memory_notify (MEM_CANCEL_OFFLINE , &arg);/* pushback to free area */ undo_isolate_page_range (start_pfn, end_pfn,MIGRATE_MOVABLE );
mm/mm_init.c +3 -4
@@ -55,13 +55,12 @@ void __init mminit_verify_zonelist(void)/* Iterate the zonelist */ for_each_zone_zonelist (zone, z, zonelist, zoneid) {#ifdef CONFIG_NUMA -printk (KERN_CONT "%d:%s " , - zone->node, zone->name); +pr_cont ("%d:%s " , zone->node, zone->name);#else -printk (KERN_CONT "0:%s " , zone->name); +pr_cont ("0:%s " , zone->name);#endif /* CONFIG_NUMA */ } -printk (KERN_CONT "\n" ); +pr_cont ("\n" ); } } }
mm/nobootmem.c +2 -2
@@ -288,7 +288,7 @@ static void * __init ___alloc_bootmem(unsigned long size, unsigned long align,/* * Whoops, we cannot satisfy the allocation request. */ -printk (KERN_ALERT "bootmem alloc of %lu bytes failed!\n" , size); +pr_alert ("bootmem alloc of %lu bytes failed!\n" , size);panic ("Out of memory" );return NULL ; }
@@ -360,7 +360,7 @@ static void * __init ___alloc_bootmem_node(pg_data_t *pgdat, unsigned long size,if (ptr)return ptr; -printk (KERN_ALERT "bootmem alloc of %lu bytes failed!\n" , size); +pr_alert ("bootmem alloc of %lu bytes failed!\n" , size);panic ("Out of memory" );return NULL ; }
mm/page_alloc.c +9 -15
@@ -544,11 +544,11 @@ static int __init debug_guardpage_minorder_setup(char *buf)unsigned long res;if (kstrtoul (buf,10 , &res) <0 || res >MAX_ORDER /2 ) { -printk (KERN_ERR "Bad debug_guardpage_minorder value\n" ); +pr_err ("Bad debug_guardpage_minorder value\n" );return 0 ; } _debug_guardpage_minorder = res; -printk (KERN_INFO "Setting debug_guardpage_minorder to %lu\n" , res); +pr_info ("Setting debug_guardpage_minorder to %lu\n" , res);return 0 ; }__setup ("debug_guardpage_minorder=" , debug_guardpage_minorder_setup);
@@ -4194,8 +4194,7 @@ static int __parse_numa_zonelist_order(char *s) }else if (*s =='z' || *s =='Z' ) { user_zonelist_order =ZONELIST_ORDER_ZONE ; }else { -printk (KERN_WARNING -"Ignoring invalid numa_zonelist_order value: %s\n" , s); +pr_warn ("Ignoring invalid numa_zonelist_order value: %s\n" , s);return -EINVAL ; }return 0 ;
@@ -5579,8 +5578,7 @@ static void __paginginit free_area_init_core(struct pglist_data *pgdat)" %s zone: %lu pages used for memmap\n" , zone_names[j], memmap_pages); }else -printk (KERN_WARNING -" %s zone: %lu pages exceeds freesize %lu\n" , +pr_warn (" %s zone: %lu pages exceeds freesize %lu\n" , zone_names[j], memmap_pages, freesize); }
@@ -5788,8 +5786,7 @@ static unsigned long __init find_min_pfn_for_node(int nid) min_pfn =min (min_pfn, start_pfn);if (min_pfn ==ULONG_MAX ) { -printk (KERN_WARNING -"Could not find start_pfn for node %d\n" , nid); +pr_warn ("Could not find start_pfn for node %d\n" , nid);return 0 ; }
@@ -6807,11 +6804,8 @@ void *__init alloc_large_system_hash(const char *tablename,if (!table)panic ("Failed to allocate %s hash table\n" , tablename); -printk (KERN_INFO "%s hash table entries: %ld (order: %d, %lu bytes)\n" , - tablename, - (1UL << log2qty), -ilog2 (size) -PAGE_SHIFT , - size); +pr_info ("%s hash table entries: %ld (order: %d, %lu bytes)\n" , + tablename,1UL << log2qty,ilog2 (size) -PAGE_SHIFT , size);if (_hash_shift) *_hash_shift = log2qty;
@@ -7312,8 +7306,8 @@ __offline_isolated_pages(unsigned long start_pfn, unsigned long end_pfn)BUG_ON (!PageBuddy (page)); order =page_order (page);#ifdef CONFIG_DEBUG_VM -printk (KERN_INFO "remove from free list %lx %d %lx\n" , - pfn,1 << order, end_pfn); +pr_info ("remove from free list %lx %d %lx\n" , + pfn,1 << order, end_pfn);#endif list_del (&page->lru);rmv_page_order (page);
mm/page_io.c +11 -11
@@ -56,10 +56,10 @@ void end_swap_bio_write(struct bio *bio)* Also clear PG_reclaim to avoid rotate_reclaimable_page() */ set_page_dirty (page); -printk (KERN_ALERT "Write-error on swap-device (%u:%u:%Lu)\n" , -imajor (bio->bi_bdev->bd_inode), -iminor (bio->bi_bdev->bd_inode), - (unsigned long long )bio->bi_iter.bi_sector); +pr_alert ("Write-error on swap-device (%u:%u:%llu)\n" , +imajor (bio->bi_bdev->bd_inode), +iminor (bio->bi_bdev->bd_inode), + (unsigned long long )bio->bi_iter.bi_sector);ClearPageReclaim (page); }end_page_writeback (page);
@@ -73,10 +73,10 @@ static void end_swap_bio_read(struct bio *bio)if (bio->bi_error) {SetPageError (page);ClearPageUptodate (page); -printk (KERN_ALERT "Read-error on swap-device (%u:%u:%Lu)\n" , -imajor (bio->bi_bdev->bd_inode), -iminor (bio->bi_bdev->bd_inode), - (unsigned long long )bio->bi_iter.bi_sector); +pr_alert ("Read-error on swap-device (%u:%u:%llu)\n" , +imajor (bio->bi_bdev->bd_inode), +iminor (bio->bi_bdev->bd_inode), + (unsigned long long )bio->bi_iter.bi_sector); goto out; }
@@ -216,7 +216,7 @@ reprobe: out:return ret; bad_bmap: -printk (KERN_ERR "swapon: swapfile has holes\n" ); +pr_err ("swapon: swapfile has holes\n" ); ret = -EINVAL ; goto out; }
@@ -290,8 +290,8 @@ int __swap_writepage(struct page *page, struct writeback_control *wbc,*/ set_page_dirty (page);ClearPageReclaim (page); -pr_err_ratelimited ("Write error on dio swapfile (%Lu)\n" , -page_file_offset (page)); +pr_err_ratelimited ("Write error on dio swapfile (%llu)\n" , +page_file_offset (page)); }end_page_writeback (page);return ret;
mm/page_poison.c +2 -2
@@ -116,9 +116,9 @@ static void check_poison_mem(unsigned char *mem, size_t bytes)if (!__ratelimit (&ratelimit))return ;else if (start == end &&single_bit_flip (*start,PAGE_POISON )) -printk (KERN_ERR "pagealloc: single bit error\n" ); +pr_err ("pagealloc: single bit error\n" );else -printk (KERN_ERR "pagealloc: memory corruption\n" ); +pr_err ("pagealloc: memory corruption\n" );print_hex_dump (KERN_ERR ,"" ,DUMP_PREFIX_ADDRESS ,16 ,1 , start, end - start +1 ,1 );
mm/percpu-km.c +3 -3
@@ -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 */ if (ai->nr_groups !=1 ) { -printk (KERN_CRIT "percpu: can't handle more than one groups\n" ); +pr_crit ("percpu: can't handle more than one groups\n" );return -EINVAL ; }
@@ -103,8 +103,8 @@ static int __init pcpu_verify_alloc_info(const struct pcpu_alloc_info *ai) alloc_pages =roundup_pow_of_two (nr_pages);if (alloc_pages > nr_pages) -printk (KERN_WARNING "percpu: wasting %zu pages per chunk\n" , - alloc_pages - nr_pages); +pr_warn ("percpu: wasting %zu pages per chunk\n" , + alloc_pages - nr_pages);return 0 ; }
mm/percpu.c +6 -6
@@ -1449,20 +1449,20 @@ static void pcpu_dump_alloc_info(const char *lvl,for (alloc_end += gi->nr_units / upa; alloc < alloc_end; alloc++) {if (!(alloc % apl)) { -printk (KERN_CONT "\n" ); +pr_cont ("\n" );printk ("%spcpu-alloc: " , lvl); } -printk (KERN_CONT "[%0*d] " , group_width, group); +pr_cont ("[%0*d] " , group_width, group);for (unit_end += upa; unit < unit_end; unit++)if (gi->cpu_map[unit] !=NR_CPUS ) -printk (KERN_CONT "%0*d " , cpu_width, - gi->cpu_map[unit]); +pr_cont ("%0*d " , + cpu_width, gi->cpu_map[unit]);else -printk (KERN_CONT "%s " , empty_str); +pr_cont ("%s " , empty_str); } } -printk (KERN_CONT "\n" ); +pr_cont ("\n" ); }/**
mm/shmem.c +6 -8
@@ -2818,9 +2818,8 @@ static int shmem_parse_options(char *options, struct shmem_sb_info *sbinfo,if ((value =strchr (this_char,'=' )) !=NULL ) { *value++ =0 ; }else { -printk (KERN_ERR -"tmpfs: No value for mount option '%s'\n" , - this_char); +pr_err ("tmpfs: No value for mount option '%s'\n" , + this_char); goto error; }
@@ -2875,8 +2874,7 @@ static int shmem_parse_options(char *options, struct shmem_sb_info *sbinfo,if (mpol_parse_str (value, &mpol)) goto bad_val; }else { -printk (KERN_ERR "tmpfs: Bad mount option %s\n" , - this_char); +pr_err ("tmpfs: Bad mount option %s\n" , this_char); goto error; } }
@@ -2884,7 +2882,7 @@ static int shmem_parse_options(char *options, struct shmem_sb_info *sbinfo,return 0 ; bad_val: -printk (KERN_ERR "tmpfs: Bad value '%s' for mount option '%s'\n" , +pr_err ("tmpfs: Bad value '%s' for mount option '%s'\n" , value, this_char); error:mpol_put (mpol);
@@ -3281,14 +3279,14 @@ int __init shmem_init(void) error =register_filesystem (&shmem_fs_type);if (error) { -printk (KERN_ERR "Could not register tmpfs\n" ); +pr_err ("Could not register tmpfs\n" ); goto out2; } shm_mnt =kern_mount (&shmem_fs_type);if (IS_ERR (shm_mnt)) { error =PTR_ERR (shm_mnt); -printk (KERN_ERR "Could not kern_mount tmpfs\n" ); +pr_err ("Could not kern_mount tmpfs\n" ); goto out1; }return 0 ;
mm/slab.c +27 -32
160 lines not on this page · raw message
mm/slab_common.c +1 -1
@@ -442,7 +442,7 @@ out_unlock:panic ("kmem_cache_create: Failed to create slab '%s'. Error %d\n" , name, err); else { -printk (KERN_WARNING "kmem_cache_create(%s) failed with error %d" , +pr_warn ("kmem_cache_create(%s) failed with error %d\n" , name, err);dump_stack (); }
mm/sparse-vmemmap.c +3 -3
@@ -166,8 +166,8 @@ void __meminit vmemmap_verify(pte_t *pte, int node,int actual_node =early_pfn_to_nid (pfn);if (node_distance (actual_node, node) >LOCAL_DISTANCE ) -printk (KERN_WARNING "[%lx-%lx] potential offnode page_structs\n" , - start, end -1 ); +pr_warn ("[%lx-%lx] potential offnode page_structs\n" , + start, end -1 ); }pte_t *__meminit vmemmap_pte_populate (pmd_t *pmd,unsigned long addr,int node)
@@ -292,7 +292,7 @@ void __init sparse_mem_maps_populate_node(struct page **map_map,if (map_map[pnum])continue ; ms =__nr_to_section (pnum); -printk (KERN_ERR "%s: sparsemem memory map backing failed some memory will not be available.\n" , +pr_err ("%s: sparsemem memory map backing failed some memory will not be available\n" , __func__); ms->section_mem_map =0 ; }
mm/sparse.c +7 -10
@@ -313,9 +313,8 @@ static void __init check_usemap_section_nr(int nid, unsigned long *usemap) usemap_nid =sparse_early_nid (__nr_to_section (usemap_snr));if (usemap_nid != nid) { -printk (KERN_INFO -"node %d must be removed before remove section %ld\n" , - nid, usemap_snr); +pr_info ("node %d must be removed before remove section %ld\n" , + nid, usemap_snr);return ; }/*
@@ -324,10 +323,8 @@ static void __init check_usemap_section_nr(int nid, unsigned long *usemap)* gather other removable sections for dynamic partitioning. * Just notify un-removable section's number here. */ -printk (KERN_INFO "Section %ld and %ld (node %d)" , usemap_snr, - pgdat_snr, nid); -printk (KERN_CONT -" have a circular dependency on usemap and pgdat allocations\n" ); +pr_info ("Section %ld and %ld (node %d) have a circular dependency on usemap and pgdat allocations\n" , + usemap_snr, pgdat_snr, nid); }#else static unsigned long * __init
@@ -355,7 +352,7 @@ static void __init sparse_early_usemaps_alloc_node(void *data, usemap =sparse_early_usemaps_alloc_pgdat_section (NODE_DATA (nodeid), size * usemap_count);if (!usemap) { -printk (KERN_WARNING "%s: allocation failed\n" , __func__); +pr_warn ("%s: allocation failed\n" , __func__);return ; }
@@ -428,7 +425,7 @@ void __init sparse_mem_maps_populate_node(struct page **map_map,if (map_map[pnum])continue ; ms =__nr_to_section (pnum); -printk (KERN_ERR "%s: sparsemem memory map backing failed some memory will not be available.\n" , +pr_err ("%s: sparsemem memory map backing failed some memory will not be available\n" , __func__); ms->section_mem_map =0 ; }
@@ -456,7 +453,7 @@ static struct page __init *sparse_early_mem_map_alloc(unsigned long pnum)if (map)return map; -printk (KERN_ERR "%s: sparsemem memory map backing failed some memory will not be available.\n" , +pr_err ("%s: sparsemem memory map backing failed some memory will not be available\n" , __func__); ms->section_mem_map =0 ;return NULL ;
mm/swap_cgroup.c +2 -3
@@ -174,9 +174,8 @@ int swap_cgroup_swapon(int type, unsigned long max_pages)return 0 ; nomem: -printk (KERN_INFO "couldn't allocate enough memory for swap_cgroup.\n" ); -printk (KERN_INFO -"swap_cgroup can be disabled by swapaccount=0 boot option\n" ); +pr_info ("couldn't allocate enough memory for swap_cgroup\n" ); +pr_info ("swap_cgroup can be disabled by swapaccount=0 boot option\n" );return -ENOMEM ; }
Signature · 7 lines
2.6.3.368.gf34be46 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH 3/4] mm: Convert printk(KERN_<LEVEL> to pr_<level>
Quoted 10 lines · Joe Perches
Most of the mm subsystem uses pr_<level> so make it consistent.
Miscellanea:
o Realign arguments
o Add missing newline to format
okmemleak-test.chas a "kmemleak: " prefix added to the "Kmemleak testing" logging message viapr_fmtSigned-off-by Joe Perches <[email protected]>
For percpu,
Thanks.
Signature · 1 line
tejun
PATCH 4/4 mm: percpu: Use pr_fmt to prefix output
In reply to Joe PerchesUse the normal mechanism to make the logging output consistently "percpu: " instead of a mix of "PERCPU: " and "percpu: "
--- mm/percpu-km.c | 4 ++-- mm/percpu.c | 20 +++++++++++--------- 2 files changed, 13 insertions(+), 11 deletions(-)
mm/percpu-km.c +2 -2
@@ -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 */ 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 ; }
@@ -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);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);return 0 ;
mm/percpu.c +11 -9
@@ -53,6 +53,8 @@* setup the first chunk containing the kernel static percpu area */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/bitmap.h> #include <linux/bootmem.h> #include <linux/err.h>
@@ -1033,11 +1035,11 @@ fail_unlock:spin_unlock_irqrestore (&pcpu_lock, flags); fail: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);dump_stack ();if (!--warn_limit) -pr_info ("PERCPU: limit reached, disable warning\n" ); +pr_info ("limit reached, disable warning\n" ); }if (is_atomic) {/* see the flag handling in pcpu_blance_workfn() */
@@ -1538,8 +1540,8 @@ int __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai,#define PCPU_SETUP_BUG_ON (cond) do { \ if (unlikely(cond)) { \ - pr_emerg("PERCPU: failed to initialize, %s", #cond); \ - pr_emerg("PERCPU: cpu_possible_mask=%*pb\n", \ + pr_emerg("failed to initialize, %s\n", #cond); \ + pr_emerg("cpu_possible_mask=%*pb\n", \ cpumask_pr_args(cpu_possible_mask)); \ pcpu_dump_alloc_info(KERN_EMERG, ai); \ BUG(); \
@@ -1723,7 +1725,7 @@ static int __init percpu_alloc_setup(char *str) pcpu_chosen_fc =PCPU_FC_PAGE ;#endif else - pr_warn("PERCPU: unknown allocator %s specified\n", str); + pr_warn("unknown allocator %s specified\n", str);return 0 ; }
@@ -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 */ 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 );#ifdef CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK /* and fail if we have fallback */
@@ -2025,7 +2027,7 @@ int __init pcpu_embed_first_chunk(size_t reserved_size, size_t dyn_size,#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, ai->dyn_size, ai->unit_size);
@@ -2099,7 +2101,7 @@ int __init pcpu_page_first_chunk(size_t reserved_size, ptr =alloc_fn (cpu,PAGE_SIZE ,PAGE_SIZE );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); goto enomem; }
@@ -2139,7 +2141,7 @@ int __init pcpu_page_first_chunk(size_t reserved_size, }/* 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, ai->reserved_size, ai->dyn_size);
Signature · 7 lines
2.6.3.368.gf34be46 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH 4/4] mm: percpu: Use pr_fmt to prefix output
Quoted 4 lines · Joe Perches
Use the normal mechanism to make the logging output consistently "percpu: " instead of a mix of "PERCPU: " and "percpu: "
Signed-off-by Joe Perches <[email protected]>
Andrew, I think it'd be best to route this one with the rest of the series through -mm.
Thanks!
Signature · 7 lines
tejun -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>