From: Yasunori Goto <y-goto@jp.fujitsu.com>
To: Linux Hotplug Memory Support <lhms-devel@lists.sourceforge.net>,
linux-mm <linux-mm@kvack.org>
Cc: Mel Gorman <mel@csn.ul.ie>, Nick Piggin <nickpiggin@yahoo.com.au>
Subject: [Patch:RFC] New zone ZONE_EASY_RECLAIM[3/5]
Date: Thu, 10 Nov 2005 19:41:10 +0900 [thread overview]
Message-ID: <20051110190126.0238.Y-GOTO@jp.fujitsu.com> (raw)
This is changing build_zonelists for new zone.
Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>
---
Index: new_zone/mm/page_alloc.c
===================================================================
--- new_zone.orig/mm/page_alloc.c 2005-11-08 17:23:24.000000000 +0900
+++ new_zone/mm/page_alloc.c 2005-11-08 17:27:26.000000000 +0900
@@ -1407,6 +1407,10 @@ static int __init build_zonelists_node(p
struct zone *zone;
default:
BUG();
+ case ZONE_EASY_RECLAIM:
+ zone = pgdat->node_zones + ZONE_EASY_RECLAIM;
+ if (zone->present_pages)
+ zonelist->zones[j++] = zone;
case ZONE_HIGHMEM:
zone = pgdat->node_zones + ZONE_HIGHMEM;
if (zone->present_pages) {
@@ -1428,6 +1432,20 @@ static int __init build_zonelists_node(p
return j;
}
+static inline int highest_zone(int i)
+{
+ int res = ZONE_NORMAL;
+
+ if (i == fls(__GFP_EASY_RECLAIM))
+ res = ZONE_EASY_RECLAIM;
+ else if(i == fls(__GFP_HIGHMEM))
+ res = ZONE_HIGHMEM;
+ else if(i == fls(__GFP_DMA))
+ res = ZONE_DMA;
+
+ return res;
+}
+
#ifdef CONFIG_NUMA
#define MAX_NODE_LOAD (num_online_nodes())
static int __initdata node_load[MAX_NUMNODES];
@@ -1524,11 +1542,7 @@ static void __init build_zonelists(pg_da
zonelist = pgdat->node_zonelists + i;
for (j = 0; zonelist->zones[j] != NULL; j++);
- k = ZONE_NORMAL;
- if (i & __GFP_HIGHMEM)
- k = ZONE_HIGHMEM;
- if (i & __GFP_DMA)
- k = ZONE_DMA;
+ k = highest_zone(i);
j = build_zonelists_node(NODE_DATA(node), zonelist, j, k);
zonelist->zones[j] = NULL;
@@ -1549,11 +1563,7 @@ static void __init build_zonelists(pg_da
zonelist = pgdat->node_zonelists + i;
j = 0;
- k = ZONE_NORMAL;
- if (i & __GFP_HIGHMEM)
- k = ZONE_HIGHMEM;
- if (i & __GFP_DMA)
- k = ZONE_DMA;
+ k = highest_zone(i);
j = build_zonelists_node(pgdat, zonelist, j, k);
/*
--
Yasunori Goto
--
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>
reply other threads:[~2005-11-10 10:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20051110190126.0238.Y-GOTO@jp.fujitsu.com \
--to=y-goto@jp.fujitsu.com \
--cc=lhms-devel@lists.sourceforge.net \
--cc=linux-mm@kvack.org \
--cc=mel@csn.ul.ie \
--cc=nickpiggin@yahoo.com.au \
/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