Commit:     8ef8286689c6b5bc76212437b85bdd2ba749ee44
Parent:     53b8a315b76a3f3c70a5644976c0095460eb13d8
Author:     Christoph Lameter <[EMAIL PROTECTED]>
AuthorDate: Tue Feb 20 13:57:52 2007 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue Feb 20 17:10:13 2007 -0800

    [PATCH] slab: reduce size of alien cache to cover only possible nodes
    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 
    of the slab allocator and so I moved the setup_nr_node_ids() into
    Signed-off-by: Christoph Lameter <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 mm/page_alloc.c |    2 +-
 mm/slab.c       |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index f66538b..4173739 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2964,6 +2964,7 @@ void __init free_area_init_nodes(unsigned long 
        /* 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,
@@ -3189,7 +3190,6 @@ static int __init init_per_zone_pages_min(void)
                min_free_kbytes = 65536;
-       setup_nr_node_ids();
        return 0;
diff --git a/mm/slab.c b/mm/slab.c
index 70784b8..8fdaffa 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -1042,7 +1042,7 @@ static void *alternate_node_alloc(struct kmem_cache *, 
 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)
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to