From: Gavin Shan <shangw@linux.vnet.ibm.com>
To: linux-mm@kvack.org
Cc: minchan@kernel.org, mgorman@suse.de, akpm@linux-foundation.org,
Gavin Shan <shangw@linux.vnet.ibm.com>
Subject: [PATCH] mm/buddy: get the allownodes for dump at once
Date: Thu, 14 Jun 2012 16:35:10 +0800 [thread overview]
Message-ID: <1339662910-25774-1-git-send-email-shangw@linux.vnet.ibm.com> (raw)
When dumping the statistics for zones in the allowed nodes in the
function show_free_areas(), skip_free_areas_node() got called for
multiple times to figure out the same information: the allowed nodes
for dump. It's reasonable to get the allowed nodes at once.
Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
---
mm/page_alloc.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 7892f84..211004e 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2765,11 +2765,19 @@ out:
*/
void show_free_areas(unsigned int filter)
{
- int cpu;
+ int nid, cpu;
+ nodemask_t allownodes;
struct zone *zone;
+ /* Figure out the allowed nodes for dump */
+ nodes_clear(allownodes);
+ for_each_online_node(nid) {
+ if (!skip_free_areas_node(filter, nid))
+ node_set(nid, allownodes);
+ }
+
for_each_populated_zone(zone) {
- if (skip_free_areas_node(filter, zone_to_nid(zone)))
+ if (!node_isset(zone_to_nid(zone), allownodes))
continue;
show_node(zone);
printk("%s per-cpu:\n", zone->name);
@@ -2812,7 +2820,7 @@ void show_free_areas(unsigned int filter)
for_each_populated_zone(zone) {
int i;
- if (skip_free_areas_node(filter, zone_to_nid(zone)))
+ if (!node_isset(zone_to_nid(zone), allownodes))
continue;
show_node(zone);
printk("%s"
@@ -2881,7 +2889,7 @@ void show_free_areas(unsigned int filter)
for_each_populated_zone(zone) {
unsigned long nr[MAX_ORDER], flags, order, total = 0;
- if (skip_free_areas_node(filter, zone_to_nid(zone)))
+ if (!node_isset(zone_to_nid(zone), allownodes))
continue;
show_node(zone);
printk("%s: ", zone->name);
--
1.7.9.5
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next reply other threads:[~2012-06-14 8:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-14 8:35 Gavin Shan [this message]
2012-06-18 2:57 ` [PATCH] mm/buddy: get the allownodes for dump at once Cong Wang
2012-06-18 3:13 ` Gavin Shan
2012-06-21 1:19 ` David Rientjes
2012-06-21 4:47 ` Gavin Shan
2012-06-21 5:13 ` David Rientjes
2012-06-21 5:16 ` Gavin Shan
2012-06-21 9:03 ` Cong Wang
2012-06-21 9:11 ` Gavin Shan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1339662910-25774-1-git-send-email-shangw@linux.vnet.ibm.com \
--to=shangw@linux.vnet.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=minchan@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).