diff options
author | Joe Perches <joe@perches.com> | 2011-10-31 20:08:48 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-31 20:30:48 -0400 |
commit | de7d2b567d040e3b67fe7121945982f14343213d (patch) | |
tree | c834efc1b4117049b5da786417d9cc14c2b31076 /mm/vmalloc.c | |
parent | f0dfcde099453aa4c0dc42473828d15a6d492936 (diff) |
mm/vmalloc.c: report more vmalloc failures
Some vmalloc failure paths do not report OOM conditions.
Add warn_alloc_failed, which also does a dump_stack, to those failure
paths.
This allows more site specific vmalloc failure logging message printks to
be removed.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/vmalloc.c')
-rw-r--r-- | mm/vmalloc.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 08ab0aa1406c..b669aa6f6caf 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c | |||
@@ -1625,13 +1625,12 @@ void *__vmalloc_node_range(unsigned long size, unsigned long align, | |||
1625 | 1625 | ||
1626 | size = PAGE_ALIGN(size); | 1626 | size = PAGE_ALIGN(size); |
1627 | if (!size || (size >> PAGE_SHIFT) > totalram_pages) | 1627 | if (!size || (size >> PAGE_SHIFT) > totalram_pages) |
1628 | return NULL; | 1628 | goto fail; |
1629 | 1629 | ||
1630 | area = __get_vm_area_node(size, align, VM_ALLOC | VM_UNLIST, | 1630 | area = __get_vm_area_node(size, align, VM_ALLOC | VM_UNLIST, |
1631 | start, end, node, gfp_mask, caller); | 1631 | start, end, node, gfp_mask, caller); |
1632 | |||
1633 | if (!area) | 1632 | if (!area) |
1634 | return NULL; | 1633 | goto fail; |
1635 | 1634 | ||
1636 | addr = __vmalloc_area_node(area, gfp_mask, prot, node, caller); | 1635 | addr = __vmalloc_area_node(area, gfp_mask, prot, node, caller); |
1637 | 1636 | ||
@@ -1649,6 +1648,12 @@ void *__vmalloc_node_range(unsigned long size, unsigned long align, | |||
1649 | kmemleak_alloc(addr, real_size, 3, gfp_mask); | 1648 | kmemleak_alloc(addr, real_size, 3, gfp_mask); |
1650 | 1649 | ||
1651 | return addr; | 1650 | return addr; |
1651 | |||
1652 | fail: | ||
1653 | warn_alloc_failed(gfp_mask, 0, | ||
1654 | "vmalloc: allocation failure: %lu bytes\n", | ||
1655 | real_size); | ||
1656 | return NULL; | ||
1652 | } | 1657 | } |
1653 | 1658 | ||
1654 | /** | 1659 | /** |