diff options
author | David Rientjes <rientjes@google.com> | 2011-05-24 20:11:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-25 11:39:03 -0400 |
commit | 7bf02ea22c6cdd09e2d3f1d3c3fe366b834ae9af (patch) | |
tree | c1c8aa415910e0f0deea1181759ddd2b5d6067fb /mm/page_alloc.c | |
parent | 851cc856d73d1185243c149ed0c0839df8a1b2fe (diff) |
arch, mm: filter disallowed nodes from arch specific show_mem functions
Architectures that implement their own show_mem() function did not pass
the filter argument to show_free_areas() to appropriately avoid emitting
the state of nodes that are disallowed in the current context. This patch
now passes the filter argument to show_free_areas() so those nodes are now
avoided.
This patch also removes the show_free_areas() wrapper around
__show_free_areas() and converts existing callers to pass an empty filter.
ia64 emits additional information for each node, so skip_free_areas_zone()
must be made global to filter disallowed nodes and it is converted to use
a nid argument rather than a zone for this use case.
Signed-off-by: David Rientjes <rientjes@google.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Helge Deller <deller@gmx.de>
Cc: James Bottomley <jejb@parisc-linux.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r-- | mm/page_alloc.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 9d5498e2d0f5..b1447522d346 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -2473,10 +2473,10 @@ void si_meminfo_node(struct sysinfo *val, int nid) | |||
2473 | #endif | 2473 | #endif |
2474 | 2474 | ||
2475 | /* | 2475 | /* |
2476 | * Determine whether the zone's node should be displayed or not, depending on | 2476 | * Determine whether the node should be displayed or not, depending on whether |
2477 | * whether SHOW_MEM_FILTER_NODES was passed to __show_free_areas(). | 2477 | * SHOW_MEM_FILTER_NODES was passed to show_free_areas(). |
2478 | */ | 2478 | */ |
2479 | static bool skip_free_areas_zone(unsigned int flags, const struct zone *zone) | 2479 | bool skip_free_areas_node(unsigned int flags, int nid) |
2480 | { | 2480 | { |
2481 | bool ret = false; | 2481 | bool ret = false; |
2482 | 2482 | ||
@@ -2484,8 +2484,7 @@ static bool skip_free_areas_zone(unsigned int flags, const struct zone *zone) | |||
2484 | goto out; | 2484 | goto out; |
2485 | 2485 | ||
2486 | get_mems_allowed(); | 2486 | get_mems_allowed(); |
2487 | ret = !node_isset(zone->zone_pgdat->node_id, | 2487 | ret = !node_isset(nid, cpuset_current_mems_allowed); |
2488 | cpuset_current_mems_allowed); | ||
2489 | put_mems_allowed(); | 2488 | put_mems_allowed(); |
2490 | out: | 2489 | out: |
2491 | return ret; | 2490 | return ret; |
@@ -2500,13 +2499,13 @@ out: | |||
2500 | * Suppresses nodes that are not allowed by current's cpuset if | 2499 | * Suppresses nodes that are not allowed by current's cpuset if |
2501 | * SHOW_MEM_FILTER_NODES is passed. | 2500 | * SHOW_MEM_FILTER_NODES is passed. |
2502 | */ | 2501 | */ |
2503 | void __show_free_areas(unsigned int filter) | 2502 | void show_free_areas(unsigned int filter) |
2504 | { | 2503 | { |
2505 | int cpu; | 2504 | int cpu; |
2506 | struct zone *zone; | 2505 | struct zone *zone; |
2507 | 2506 | ||
2508 | for_each_populated_zone(zone) { | 2507 | for_each_populated_zone(zone) { |
2509 | if (skip_free_areas_zone(filter, zone)) | 2508 | if (skip_free_areas_node(filter, zone_to_nid(zone))) |
2510 | continue; | 2509 | continue; |
2511 | show_node(zone); | 2510 | show_node(zone); |
2512 | printk("%s per-cpu:\n", zone->name); | 2511 | printk("%s per-cpu:\n", zone->name); |
@@ -2549,7 +2548,7 @@ void __show_free_areas(unsigned int filter) | |||
2549 | for_each_populated_zone(zone) { | 2548 | for_each_populated_zone(zone) { |
2550 | int i; | 2549 | int i; |
2551 | 2550 | ||
2552 | if (skip_free_areas_zone(filter, zone)) | 2551 | if (skip_free_areas_node(filter, zone_to_nid(zone))) |
2553 | continue; | 2552 | continue; |
2554 | show_node(zone); | 2553 | show_node(zone); |
2555 | printk("%s" | 2554 | printk("%s" |
@@ -2618,7 +2617,7 @@ void __show_free_areas(unsigned int filter) | |||
2618 | for_each_populated_zone(zone) { | 2617 | for_each_populated_zone(zone) { |
2619 | unsigned long nr[MAX_ORDER], flags, order, total = 0; | 2618 | unsigned long nr[MAX_ORDER], flags, order, total = 0; |
2620 | 2619 | ||
2621 | if (skip_free_areas_zone(filter, zone)) | 2620 | if (skip_free_areas_node(filter, zone_to_nid(zone))) |
2622 | continue; | 2621 | continue; |
2623 | show_node(zone); | 2622 | show_node(zone); |
2624 | printk("%s: ", zone->name); | 2623 | printk("%s: ", zone->name); |
@@ -2639,11 +2638,6 @@ void __show_free_areas(unsigned int filter) | |||
2639 | show_swap_cache_info(); | 2638 | show_swap_cache_info(); |
2640 | } | 2639 | } |
2641 | 2640 | ||
2642 | void show_free_areas(void) | ||
2643 | { | ||
2644 | __show_free_areas(0); | ||
2645 | } | ||
2646 | |||
2647 | static void zoneref_set_zone(struct zone *zone, struct zoneref *zoneref) | 2641 | static void zoneref_set_zone(struct zone *zone, struct zoneref *zoneref) |
2648 | { | 2642 | { |
2649 | zoneref->zone = zone; | 2643 | zoneref->zone = zone; |