mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* shrink zonelists.
@ 2003-05-15  3:31 davej
  0 siblings, 0 replies; only message in thread
From: davej @ 2003-05-15  3:31 UTC (permalink / raw)
  To: torvalds, akpm; +Cc: linux-kernel

Originally from Matt Dobson. I've been running with this for a while
in -dj, with no noticable side-effects.

Matt:

node_zonelists looks like it should really be declared of size 
MAX_NR_ZONES, not GFP_ZONEMASK.  GFP_ZONEMASK is currently 15, making 
node_zonelists an array of 16 elements.  The extra zonelists are all 
just duplicates of the *real* zonelists, namely the first 3 entries. 
Again, if anyone can explain to me why I'm wrong in my thinking, I'd 
love to know.  There's certainly no way you could bitwise-and something 
with any combination of the GFP_DMA and GFP_HIGHMEM flags to refer to 
the 12th zonelist or some such!  Or am I crazy?

Cheers!

-Matt

diff -urpN --exclude-from=/home/davej/.exclude bk-linus/include/linux/mmzone.h linux-2.5/include/linux/mmzone.h
--- bk-linus/include/linux/mmzone.h	2003-04-10 06:01:37.000000000 +0100
+++ linux-2.5/include/linux/mmzone.h	2003-04-22 17:33:54.000000000 +0100
@@ -146,6 +146,7 @@ struct zone {
 #define ZONE_NORMAL		1
 #define ZONE_HIGHMEM		2
 #define MAX_NR_ZONES		3
+#define GFP_ZONEMASK	0x03
 
 /*
  * One allocation request operates on a zonelist. A zonelist
@@ -162,7 +163,6 @@ struct zonelist {
 	struct zone *zones[MAX_NUMNODES * MAX_NR_ZONES + 1]; // NULL delimited
 };
 
-#define GFP_ZONEMASK	0x0f
 
 /*
  * The pg_data_t structure is used in machines with CONFIG_DISCONTIGMEM
@@ -178,7 +178,7 @@ struct zonelist {
 struct bootmem_data;
 typedef struct pglist_data {
 	struct zone node_zones[MAX_NR_ZONES];
-	struct zonelist node_zonelists[GFP_ZONEMASK+1];
+	struct zonelist node_zonelists[MAX_NR_ZONES];
 	int nr_zones;
 	struct page *node_mem_map;
 	unsigned long *valid_addr_bitmap;
diff -urpN --exclude-from=/home/davej/.exclude bk-linus/mm/page_alloc.c linux-2.5/mm/page_alloc.c
--- bk-linus/mm/page_alloc.c	2003-05-13 11:51:13.000000000 +0100
+++ linux-2.5/mm/page_alloc.c	2003-05-13 11:59:33.000000000 +0100
@@ -1041,7 +1041,7 @@ static void __init build_zonelists(pg_da
 
 	local_node = pgdat->node_id;
 	printk("Building zonelist for node : %d\n", local_node);
-	for (i = 0; i <= GFP_ZONEMASK; i++) {
+	for (i = 0; i < MAX_NR_ZONES; i++) {
 		struct zonelist *zonelist;
 
 		zonelist = pgdat->node_zonelists + i;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-05-15  3:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-15  3:31 shrink zonelists davej

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome