aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/mm.h3
-rw-r--r--mm/page_alloc.c16
-rw-r--r--mm/vmalloc.c4
3 files changed, 15 insertions, 8 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 7438071b44aa..3b3e3b8bb706 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1334,7 +1334,8 @@ extern void si_meminfo(struct sysinfo * val);
1334extern void si_meminfo_node(struct sysinfo *val, int nid); 1334extern void si_meminfo_node(struct sysinfo *val, int nid);
1335extern int after_bootmem; 1335extern int after_bootmem;
1336 1336
1337extern void warn_alloc_failed(gfp_t gfp_mask, int order, const char *fmt, ...); 1337extern __printf(3, 4)
1338void warn_alloc_failed(gfp_t gfp_mask, int order, const char *fmt, ...);
1338 1339
1339extern void setup_per_cpu_pageset(void); 1340extern void setup_per_cpu_pageset(void);
1340 1341
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 83a02052bce4..9dd443d89d8b 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1754,7 +1754,6 @@ static DEFINE_RATELIMIT_STATE(nopage_rs,
1754 1754
1755void warn_alloc_failed(gfp_t gfp_mask, int order, const char *fmt, ...) 1755void warn_alloc_failed(gfp_t gfp_mask, int order, const char *fmt, ...)
1756{ 1756{
1757 va_list args;
1758 unsigned int filter = SHOW_MEM_FILTER_NODES; 1757 unsigned int filter = SHOW_MEM_FILTER_NODES;
1759 1758
1760 if ((gfp_mask & __GFP_NOWARN) || !__ratelimit(&nopage_rs)) 1759 if ((gfp_mask & __GFP_NOWARN) || !__ratelimit(&nopage_rs))
@@ -1773,14 +1772,21 @@ void warn_alloc_failed(gfp_t gfp_mask, int order, const char *fmt, ...)
1773 filter &= ~SHOW_MEM_FILTER_NODES; 1772 filter &= ~SHOW_MEM_FILTER_NODES;
1774 1773
1775 if (fmt) { 1774 if (fmt) {
1776 printk(KERN_WARNING); 1775 struct va_format vaf;
1776 va_list args;
1777
1777 va_start(args, fmt); 1778 va_start(args, fmt);
1778 vprintk(fmt, args); 1779
1780 vaf.fmt = fmt;
1781 vaf.va = &args;
1782
1783 pr_warn("%pV", &vaf);
1784
1779 va_end(args); 1785 va_end(args);
1780 } 1786 }
1781 1787
1782 pr_warning("%s: page allocation failure: order:%d, mode:0x%x\n", 1788 pr_warn("%s: page allocation failure: order:%d, mode:0x%x\n",
1783 current->comm, order, gfp_mask); 1789 current->comm, order, gfp_mask);
1784 1790
1785 dump_stack(); 1791 dump_stack();
1786 if (!should_suppress_show_mem()) 1792 if (!should_suppress_show_mem())
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 56faf3163ee2..08ab0aa1406c 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -1593,8 +1593,8 @@ static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
1593 return area->addr; 1593 return area->addr;
1594 1594
1595fail: 1595fail:
1596 warn_alloc_failed(gfp_mask, order, "vmalloc: allocation failure, " 1596 warn_alloc_failed(gfp_mask, order,
1597 "allocated %ld of %ld bytes\n", 1597 "vmalloc: allocation failure, allocated %ld of %ld bytes\n",
1598 (area->nr_pages*PAGE_SIZE), area->size); 1598 (area->nr_pages*PAGE_SIZE), area->size);
1599 vfree(area->addr); 1599 vfree(area->addr);
1600 return NULL; 1600 return NULL;