Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 365343
b: refs/heads/master
c: 4b59e6c
h: refs/heads/master
i:
  365341: bd2870e
  365339: 624394a
  365335: 87a2920
  365327: d4287fa
  365311: 6535af6
v: v3
  • Loading branch information
David Rientjes authored and Linus Torvalds committed Apr 29, 2013
1 parent a982782 commit 4dad2e0
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 2 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: fe0bfaaff84429a35e4447d4ccd646aecf5999fb
refs/heads/master: 4b59e6c4730978679b414a8da61514a2518da512
3 changes: 3 additions & 0 deletions trunk/arch/arm/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ void show_mem(unsigned int filter)
printk("Mem-info:\n");
show_free_areas(filter);

if (filter & SHOW_MEM_FILTER_PAGE_COUNT)
return;

for_each_bank (i, mi) {
struct membank *bank = &mi->bank[i];
unsigned int pfn1, pfn2;
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/ia64/mm/contig.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ void show_mem(unsigned int filter)
printk(KERN_INFO "Mem-info:\n");
show_free_areas(filter);
printk(KERN_INFO "Node memory in pages:\n");
if (filter & SHOW_MEM_FILTER_PAGE_COUNT)
return;
for_each_online_pgdat(pgdat) {
unsigned long present;
unsigned long flags;
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/ia64/mm/discontig.c
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,8 @@ void show_mem(unsigned int filter)

printk(KERN_INFO "Mem-info:\n");
show_free_areas(filter);
if (filter & SHOW_MEM_FILTER_PAGE_COUNT)
return;
printk(KERN_INFO "Node memory in pages:\n");
for_each_online_pgdat(pgdat) {
unsigned long present;
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/parisc/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,8 @@ void show_mem(unsigned int filter)

printk(KERN_INFO "Mem-info:\n");
show_free_areas(filter);
if (filter & SHOW_MEM_FILTER_PAGE_COUNT)
return;
#ifndef CONFIG_DISCONTIGMEM
i = max_mapnr;
while (i-- > 0) {
Expand Down
3 changes: 3 additions & 0 deletions trunk/arch/unicore32/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ void show_mem(unsigned int filter)
printk(KERN_DEFAULT "Mem-info:\n");
show_free_areas(filter);

if (filter & SHOW_MEM_FILTER_PAGE_COUNT)
return;

for_each_bank(i, mi) {
struct membank *bank = &mi->bank[i];
unsigned int pfn1, pfn2;
Expand Down
3 changes: 2 additions & 1 deletion trunk/include/linux/mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,8 @@ extern void pagefault_out_of_memory(void);
* Flags passed to show_mem() and show_free_areas() to suppress output in
* various contexts.
*/
#define SHOW_MEM_FILTER_NODES (0x0001u) /* filter disallowed nodes */
#define SHOW_MEM_FILTER_NODES (0x0001u) /* disallowed nodes */
#define SHOW_MEM_FILTER_PAGE_COUNT (0x0002u) /* page type count */

extern void show_free_areas(unsigned int flags);
extern bool skip_free_areas_node(unsigned int flags, int nid);
Expand Down
3 changes: 3 additions & 0 deletions trunk/lib/show_mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ void show_mem(unsigned int filter)
printk("Mem-Info:\n");
show_free_areas(filter);

if (filter & SHOW_MEM_FILTER_PAGE_COUNT)
return;

for_each_online_pgdat(pgdat) {
unsigned long i, flags;

Expand Down
7 changes: 7 additions & 0 deletions trunk/mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2002,6 +2002,13 @@ void warn_alloc_failed(gfp_t gfp_mask, int order, const char *fmt, ...)
debug_guardpage_minorder() > 0)
return;

/*
* Walking all memory to count page types is very expensive and should
* be inhibited in non-blockable contexts.
*/
if (!(gfp_mask & __GFP_WAIT))
filter |= SHOW_MEM_FILTER_PAGE_COUNT;

/*
* This documents exceptions given to allocations in certain
* contexts that are allowed to allocate outside current's set
Expand Down

0 comments on commit 4dad2e0

Please sign in to comment.