From: Mel Gorman <mel@csn.ul.ie>
To: linux-mm@kvack.org
Cc: Mel Gorman <mel@csn.ul.ie>,
linux-kernel@vger.kernel.org, lhms-devel@lists.sourceforge.net
Subject: [PATCH 2/7] Create the ZONE_EASYRCLM zone
Date: Fri, 17 Feb 2006 14:16:32 +0000 (GMT) [thread overview]
Message-ID: <20060217141632.7621.62675.sendpatchset@skynet.csn.ul.ie> (raw)
In-Reply-To: <20060217141552.7621.74444.sendpatchset@skynet.csn.ul.ie>
This patch adds the ZONE_EASYRCLM zone and updates relevant contants and
helper functions. After this patch is applied, memory that is hot-added on
the x86 will be placed in ZONE_EASYRCLM. Memory hot-added on the ppc64 still
goes to ZONE_DMA.
Signed-off-by: Mel Gorman <mel@csn.ul.ie>
diff -rup -X /usr/src/patchset-0.5/bin//dontdiff linux-2.6.16-rc3-mm1-101_antifrag_flags/arch/x86_64/mm/init.c linux-2.6.16-rc3-mm1-102_addzone/arch/x86_64/mm/init.c
--- linux-2.6.16-rc3-mm1-101_antifrag_flags/arch/x86_64/mm/init.c 2006-02-16 09:50:42.000000000 +0000
+++ linux-2.6.16-rc3-mm1-102_addzone/arch/x86_64/mm/init.c 2006-02-17 09:42:01.000000000 +0000
@@ -495,7 +495,7 @@ void online_page(struct page *page)
int add_memory(u64 start, u64 size)
{
struct pglist_data *pgdat = NODE_DATA(0);
- struct zone *zone = pgdat->node_zones + MAX_NR_ZONES-2;
+ struct zone *zone = pgdat->node_zones + MAX_NR_ZONES-3;
unsigned long start_pfn = start >> PAGE_SHIFT;
unsigned long nr_pages = size >> PAGE_SHIFT;
int ret;
diff -rup -X /usr/src/patchset-0.5/bin//dontdiff linux-2.6.16-rc3-mm1-101_antifrag_flags/include/linux/mmzone.h linux-2.6.16-rc3-mm1-102_addzone/include/linux/mmzone.h
--- linux-2.6.16-rc3-mm1-101_antifrag_flags/include/linux/mmzone.h 2006-02-13 00:27:25.000000000 +0000
+++ linux-2.6.16-rc3-mm1-102_addzone/include/linux/mmzone.h 2006-02-17 09:42:01.000000000 +0000
@@ -73,9 +73,10 @@ struct per_cpu_pageset {
#define ZONE_DMA32 1
#define ZONE_NORMAL 2
#define ZONE_HIGHMEM 3
+#define ZONE_EASYRCLM 4
-#define MAX_NR_ZONES 4 /* Sync this with ZONES_SHIFT */
-#define ZONES_SHIFT 2 /* ceil(log2(MAX_NR_ZONES)) */
+#define MAX_NR_ZONES 5 /* Sync this with ZONES_SHIFT */
+#define ZONES_SHIFT 3 /* ceil(log2(MAX_NR_ZONES)) */
/*
@@ -103,7 +104,7 @@ struct per_cpu_pageset {
*
* NOTE! Make sure this matches the zones in <linux/gfp.h>
*/
-#define GFP_ZONEMASK 0x07
+#define GFP_ZONEMASK 0x0f
/* #define GFP_ZONETYPES (GFP_ZONEMASK + 1) */ /* Non-loner */
#define GFP_ZONETYPES ((GFP_ZONEMASK + 1) / 2 + 1) /* Loner */
@@ -408,7 +409,7 @@ static inline int populated_zone(struct
static inline int is_highmem_idx(int idx)
{
- return (idx == ZONE_HIGHMEM);
+ return (idx == ZONE_HIGHMEM || idx == ZONE_EASYRCLM);
}
static inline int is_normal_idx(int idx)
@@ -424,7 +425,8 @@ static inline int is_normal_idx(int idx)
*/
static inline int is_highmem(struct zone *zone)
{
- return zone == zone->zone_pgdat->node_zones + ZONE_HIGHMEM;
+ return zone == zone->zone_pgdat->node_zones + ZONE_HIGHMEM ||
+ zone == zone->zone_pgdat->node_zones + ZONE_EASYRCLM;
}
static inline int is_normal(struct zone *zone)
diff -rup -X /usr/src/patchset-0.5/bin//dontdiff linux-2.6.16-rc3-mm1-101_antifrag_flags/mm/page_alloc.c linux-2.6.16-rc3-mm1-102_addzone/mm/page_alloc.c
--- linux-2.6.16-rc3-mm1-101_antifrag_flags/mm/page_alloc.c 2006-02-16 09:50:44.000000000 +0000
+++ linux-2.6.16-rc3-mm1-102_addzone/mm/page_alloc.c 2006-02-17 09:42:01.000000000 +0000
@@ -68,7 +68,7 @@ static void __free_pages_ok(struct page
* TBD: should special case ZONE_DMA32 machines here - in those we normally
* don't need any ZONE_NORMAL reservation
*/
-int sysctl_lowmem_reserve_ratio[MAX_NR_ZONES-1] = { 256, 256, 32 };
+int sysctl_lowmem_reserve_ratio[MAX_NR_ZONES-1] = { 256, 256, 32, 32 };
EXPORT_SYMBOL(totalram_pages);
@@ -79,7 +79,8 @@ EXPORT_SYMBOL(totalram_pages);
struct zone *zone_table[1 << ZONETABLE_SHIFT] __read_mostly;
EXPORT_SYMBOL(zone_table);
-static char *zone_names[MAX_NR_ZONES] = { "DMA", "DMA32", "Normal", "HighMem" };
+static char *zone_names[MAX_NR_ZONES] = { "DMA", "DMA32", "Normal",
+ "HighMem", "EasyRclm" };
int min_free_kbytes = 1024;
unsigned long __initdata nr_kernel_pages;
@@ -758,6 +759,7 @@ static inline void prep_zero_page(struct
int i;
BUG_ON((gfp_flags & (__GFP_WAIT | __GFP_HIGHMEM)) == __GFP_HIGHMEM);
+ BUG_ON((gfp_flags & (__GFP_WAIT | __GFP_EASYRCLM)) == __GFP_EASYRCLM);
for(i = 0; i < (1 << order); i++)
clear_highpage(page + i);
}
@@ -1266,7 +1268,7 @@ unsigned int nr_free_buffer_pages(void)
*/
unsigned int nr_free_pagecache_pages(void)
{
- return nr_free_zone_pages(gfp_zone(GFP_HIGHUSER));
+ return nr_free_zone_pages(gfp_zone(GFP_RCLMUSER));
}
#ifdef CONFIG_HIGHMEM
@@ -1276,7 +1278,7 @@ unsigned int nr_free_highpages (void)
unsigned int pages = 0;
for_each_pgdat(pgdat)
- pages += pgdat->node_zones[ZONE_HIGHMEM].free_pages;
+ pages += pgdat->node_zones[ZONE_EASYRCLM].free_pages;
return pages;
}
@@ -1584,7 +1586,7 @@ static int __init build_zonelists_node(p
{
struct zone *zone;
- BUG_ON(zone_type > ZONE_HIGHMEM);
+ BUG_ON(zone_type > ZONE_EASYRCLM);
do {
zone = pgdat->node_zones + zone_type;
@@ -1604,6 +1606,8 @@ static int __init build_zonelists_node(p
static inline int highest_zone(int zone_bits)
{
int res = ZONE_NORMAL;
+ if (zone_bits & (__force int)__GFP_EASYRCLM)
+ res = ZONE_EASYRCLM;
if (zone_bits & (__force int)__GFP_HIGHMEM)
res = ZONE_HIGHMEM;
if (zone_bits & (__force int)__GFP_DMA32)
--
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 prev parent reply other threads:[~2006-02-17 14:16 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-17 14:15 [PATCH 0/7] Reducing fragmentation using zones v5 Mel Gorman
2006-02-17 14:16 ` [PATCH 1/7] Add __GFP_EASYRCLM flag and update callers Mel Gorman
2006-02-17 14:16 ` Mel Gorman [this message]
2006-02-17 14:16 ` [PATCH 3/7] x86 - Specify amount of kernel memory at boot time Mel Gorman
2006-02-17 14:17 ` [PATCH 4/7] ppc64 " Mel Gorman
2006-02-17 17:16 ` Dave Hansen
2006-02-17 19:03 ` Mel Gorman
2006-02-17 19:17 ` Dave Hansen
2006-02-17 19:36 ` Mel Gorman
2006-02-17 21:31 ` Joel Schopp
2006-02-21 14:51 ` Mel Gorman
2006-02-21 17:35 ` Dave Hansen
2006-02-22 16:43 ` Mel Gorman
2006-02-23 16:42 ` Dave Hansen
2006-02-23 17:19 ` Mel Gorman
2006-02-23 17:38 ` Dave Hansen
2006-02-23 18:01 ` Mel Gorman
2006-02-23 18:15 ` Dave Hansen
2006-02-24 0:15 ` KAMEZAWA Hiroyuki
2006-02-24 9:04 ` Mel Gorman
2006-02-23 17:40 ` Mike Kravetz
2006-02-17 14:17 ` [PATCH 5/7] At boot, determine what zone memory will hot-add to Mel Gorman
2006-02-17 14:17 ` [PATCH 6/7] Allow HugeTLB allocations to use ZONE_EASYRCLM Mel Gorman
2006-02-17 14:18 ` [PATCH 7/7] Add documentation for extra boot parameters Mel Gorman
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=20060217141632.7621.62675.sendpatchset@skynet.csn.ul.ie \
--to=mel@csn.ul.ie \
--cc=lhms-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.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