From: davej@codemonkey.org.uk
To: torvalds@transmeta.com, akpm@digeo.com
Cc: linux-kernel@vger.kernel.org
Subject: shrink zonelists.
Date: Thu, 15 May 2003 04:31:16 +0100 [thread overview]
Message-ID: <200305150331.h4F3VGPN000754@deviant.impure.org.uk> (raw)
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;
reply other threads:[~2003-05-15 3:31 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=200305150331.h4F3VGPN000754@deviant.impure.org.uk \
--to=davej@codemonkey.org.uk \
--cc=akpm@digeo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome