Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 272142
b: refs/heads/master
c: 3ee9a4f
h: refs/heads/master
v: v3
  • Loading branch information
Joe Perches authored and Linus Torvalds committed Nov 1, 2011
1 parent 6cc782c commit 3914124
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 06d5e032adcbc7d50c606a1396f00e2474e4213e
refs/heads/master: 3ee9a4f086716d792219c021e8509f91165a4128
3 changes: 2 additions & 1 deletion trunk/include/linux/mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -1334,7 +1334,8 @@ extern void si_meminfo(struct sysinfo * val);
extern void si_meminfo_node(struct sysinfo *val, int nid);
extern int after_bootmem;

extern void warn_alloc_failed(gfp_t gfp_mask, int order, const char *fmt, ...);
extern __printf(3, 4)
void warn_alloc_failed(gfp_t gfp_mask, int order, const char *fmt, ...);

extern void setup_per_cpu_pageset(void);

Expand Down
16 changes: 11 additions & 5 deletions trunk/mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1754,7 +1754,6 @@ static DEFINE_RATELIMIT_STATE(nopage_rs,

void warn_alloc_failed(gfp_t gfp_mask, int order, const char *fmt, ...)
{
va_list args;
unsigned int filter = SHOW_MEM_FILTER_NODES;

if ((gfp_mask & __GFP_NOWARN) || !__ratelimit(&nopage_rs))
Expand All @@ -1773,14 +1772,21 @@ void warn_alloc_failed(gfp_t gfp_mask, int order, const char *fmt, ...)
filter &= ~SHOW_MEM_FILTER_NODES;

if (fmt) {
printk(KERN_WARNING);
struct va_format vaf;
va_list args;

va_start(args, fmt);
vprintk(fmt, args);

vaf.fmt = fmt;
vaf.va = &args;

pr_warn("%pV", &vaf);

va_end(args);
}

pr_warning("%s: page allocation failure: order:%d, mode:0x%x\n",
current->comm, order, gfp_mask);
pr_warn("%s: page allocation failure: order:%d, mode:0x%x\n",
current->comm, order, gfp_mask);

dump_stack();
if (!should_suppress_show_mem())
Expand Down
4 changes: 2 additions & 2 deletions trunk/mm/vmalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1593,8 +1593,8 @@ static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
return area->addr;

fail:
warn_alloc_failed(gfp_mask, order, "vmalloc: allocation failure, "
"allocated %ld of %ld bytes\n",
warn_alloc_failed(gfp_mask, order,
"vmalloc: allocation failure, allocated %ld of %ld bytes\n",
(area->nr_pages*PAGE_SIZE), area->size);
vfree(area->addr);
return NULL;
Expand Down

0 comments on commit 3914124

Please sign in to comment.