aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-07-31 06:25:37 -1000
committerLinus Torvalds <torvalds@linux-foundation.org>2011-07-31 06:25:37 -1000
commit6581058f44533f9d45548bcfe986c125376859e9 (patch)
treea5c811ace1fea5bccfbc5146048b5d2b3655bdcf
parentfa9d594c46679485c5e3642d2bd9e874a7e07b19 (diff)
parenteacbbae385bf492229e84024863960d3160547c7 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/slab-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/slab-2.6: slab: use NUMA_NO_NODE slab: remove one NR_CPUS dependency
-rw-r--r--mm/slab.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/mm/slab.c b/mm/slab.c
index 1e523ed47c6..95947400702 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3403,7 +3403,7 @@ __cache_alloc_node(struct kmem_cache *cachep, gfp_t flags, int nodeid,
cache_alloc_debugcheck_before(cachep, flags);
local_irq_save(save_flags);
- if (nodeid == -1)
+ if (nodeid == NUMA_NO_NODE)
nodeid = slab_node;
if (unlikely(!cachep->nodelists[nodeid])) {
@@ -3934,7 +3934,7 @@ fail:
struct ccupdate_struct {
struct kmem_cache *cachep;
- struct array_cache *new[NR_CPUS];
+ struct array_cache *new[0];
};
static void do_ccupdate_local(void *info)
@@ -3956,7 +3956,8 @@ static int do_tune_cpucache(struct kmem_cache *cachep, int limit,
struct ccupdate_struct *new;
int i;
- new = kzalloc(sizeof(*new), gfp);
+ new = kzalloc(sizeof(*new) + nr_cpu_ids * sizeof(struct array_cache *),
+ gfp);
if (!new)
return -ENOMEM;