linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Lameter <clameter@sgi.com>
To: akpm@linux-foundation.org
Cc: linux-mm@kvack.org, Pekka Enberg <penberg@cs.helsinki.fi>
Subject: Slab: reduce size of alien cache to cover only possible nodes
Date: Thu, 1 Feb 2007 23:45:44 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0702012343020.17885@schroedinger.engr.sgi.com> (raw)

The alien cache is a per cpu per node array allocated for every slab
on the system. Currently we size this array for all nodes
that the kernel does support. For IA64 this is 1024 nodes. So we allocate
an array with 1024 objects even if we only boot a system with 4 nodes.

This patch uses "nr_node_ids" to determine the number of possible nodes 
supported by a hardware configuration and only allocates an alien cache 
sized for possible nodes.

The initialization of nr_node_ids occurred too late relative to the bootstrap
of the slab allocator and so I moved the setup_nr_node_ids() into
free_area_init_nodes().

Signed-off-by: Christoph Lameter <clameter@sgi.com>

Index: current/mm/slab.c
===================================================================
--- current.orig/mm/slab.c	2007-02-01 23:08:02.000000000 -0800
+++ current/mm/slab.c	2007-02-01 23:08:03.000000000 -0800
@@ -1042,7 +1042,7 @@ static void *alternate_node_alloc(struct
 static struct array_cache **alloc_alien_cache(int node, int limit)
 {
 	struct array_cache **ac_ptr;
-	int memsize = sizeof(void *) * MAX_NUMNODES;
+	int memsize = sizeof(void *) * nr_node_ids;
 	int i;
 
 	if (limit > 1)
Index: current/mm/page_alloc.c
===================================================================
--- current.orig/mm/page_alloc.c	2007-02-01 23:07:56.000000000 -0800
+++ current/mm/page_alloc.c	2007-02-01 23:40:03.000000000 -0800
@@ -3079,6 +3079,7 @@ void __init free_area_init_nodes(unsigne
 						early_node_map[i].end_pfn);
 
 	/* Initialise every node */
+	setup_nr_node_ids();
 	for_each_online_node(nid) {
 		pg_data_t *pgdat = NODE_DATA(nid);
 		free_area_init_node(nid, pgdat, NULL,
@@ -3304,7 +3305,6 @@ static int __init init_per_zone_pages_mi
 		min_free_kbytes = 65536;
 	setup_per_zone_pages_min();
 	setup_per_zone_lowmem_reserve();
-	setup_nr_node_ids();
 	return 0;
 }
 module_init(init_per_zone_pages_min)

--
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:[~2007-02-02  7:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-02  7:45 Christoph Lameter [this message]
2007-02-02  7:55 ` Slab: reduce size of alien cache to cover only possible nodes Andrew Morton
2007-02-02 19:13   ` Christoph Lameter

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=Pine.LNX.4.64.0702012343020.17885@schroedinger.engr.sgi.com \
    --to=clameter@sgi.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=penberg@cs.helsinki.fi \
    /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;
as well as URLs for NNTP newsgroup(s).