All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Dobson <colpatch@us.ibm.com>
To: Andrew Morton <akpm@digeo.com>,
	"Martin J. Bligh" <mbligh@aracnet.com>,
	William Lee Irwin III <wli@holomorphy.com>,
	linux-kernel@vger.kernel.org
Subject: [patch] GFP_ZONEMASK vs. MAX_NR_ZONES
Date: Mon, 17 Mar 2003 17:53:08 -0800	[thread overview]
Message-ID: <3E767C04.3000604@us.ibm.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1012 bytes --]

Ok...  hot on the heels of the other GFP_ZONEMASK patch:

struct bootmem_data;
typedef struct pglist_data {
	struct zone node_zones[MAX_NR_ZONES];
	struct zonelist node_zonelists[GFP_ZONEMASK+1];
	int nr_zones;
	struct page *node_mem_map;
	unsigned long *valid_addr_bitmap;
	struct bootmem_data *bdata;
	unsigned long node_start_pfn;
	unsigned long node_size;
	int node_id;
	struct pglist_data *pgdat_next;
	wait_queue_head_t       kswapd_wait;
} pg_data_t;

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

[-- Attachment #2: zonelist_fix-2.5.65.patch --]
[-- Type: text/plain, Size: 1105 bytes --]

diff -Nur --exclude-from=/usr/src/.dontdiff linux-2.5.64-vanilla/include/linux/mmzone.h linux-2.5.64-zonelist_fix/include/linux/mmzone.h
--- linux-2.5.64-vanilla/include/linux/mmzone.h	Tue Mar  4 19:29:22 2003
+++ linux-2.5.64-zonelist_fix/include/linux/mmzone.h	Mon Mar 17 14:13:02 2003
@@ -178,7 +178,7 @@
 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 -Nur --exclude-from=/usr/src/.dontdiff linux-2.5.64-vanilla/mm/page_alloc.c linux-2.5.64-zonelist_fix/mm/page_alloc.c
--- linux-2.5.64-vanilla/mm/page_alloc.c	Tue Mar  4 19:28:58 2003
+++ linux-2.5.64-zonelist_fix/mm/page_alloc.c	Mon Mar 17 14:13:02 2003
@@ -1028,7 +1028,7 @@
 
 	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;

             reply	other threads:[~2003-03-18  1:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-18  1:53 Matthew Dobson [this message]
2003-03-18  2:54 ` [patch] GFP_ZONEMASK vs. MAX_NR_ZONES William Lee Irwin III

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=3E767C04.3000604@us.ibm.com \
    --to=colpatch@us.ibm.com \
    --cc=akpm@digeo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbligh@aracnet.com \
    --cc=wli@holomorphy.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.