linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Slab: reduce size of alien cache to cover only possible nodes
@ 2007-02-02  7:45 Christoph Lameter
  2007-02-02  7:55 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Lameter @ 2007-02-02  7:45 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, Pekka Enberg

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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Slab: reduce size of alien cache to cover only possible nodes
  2007-02-02  7:45 Slab: reduce size of alien cache to cover only possible nodes Christoph Lameter
@ 2007-02-02  7:55 ` Andrew Morton
  2007-02-02 19:13   ` Christoph Lameter
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2007-02-02  7:55 UTC (permalink / raw)
  To: Christoph Lameter; +Cc: linux-mm, Pekka Enberg

On Thu, 1 Feb 2007 23:45:44 -0800 (PST) Christoph Lameter <clameter@sgi.com> wrote:

> 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().

How does/will this play with node hotplug?  Not at all, afaict.

--
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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Slab: reduce size of alien cache to cover only possible nodes
  2007-02-02  7:55 ` Andrew Morton
@ 2007-02-02 19:13   ` Christoph Lameter
  0 siblings, 0 replies; 3+ messages in thread
From: Christoph Lameter @ 2007-02-02 19:13 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-mm, Pekka Enberg

On Thu, 1 Feb 2007, Andrew Morton wrote:

> > 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().
> 
> How does/will this play with node hotplug?  Not at all, afaict.

Plays well. You cannot plug in node that is not in the node possible map 
and we use the node possible map for nr_node_id calculation.


--
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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-02-02 19:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-02  7:45 Slab: reduce size of alien cache to cover only possible nodes Christoph Lameter
2007-02-02  7:55 ` Andrew Morton
2007-02-02 19:13   ` Christoph Lameter

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).