From cd51c82e4c83a8f50afd3543f3b02db378830d82 Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Wed, 6 Feb 2008 01:37:01 -0800 Subject: [PATCH] --- yaml --- r: 83418 b: refs/heads/master c: b3242151906372f30f57feaa43b4cac96a23edb1 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/linux/percpu.h | 2 +- trunk/mm/allocpercpu.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 263714a91be2..06fefee9b67c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e7ca2d41a029577a8cff453d1445951d4f96bfd8 +refs/heads/master: b3242151906372f30f57feaa43b4cac96a23edb1 diff --git a/trunk/include/linux/percpu.h b/trunk/include/linux/percpu.h index 50faa0ea28e4..1ac969724bb2 100644 --- a/trunk/include/linux/percpu.h +++ b/trunk/include/linux/percpu.h @@ -54,7 +54,7 @@ #ifdef CONFIG_SMP struct percpu_data { - void *ptrs[NR_CPUS]; + void *ptrs[1]; }; #define __percpu_disguise(pdata) (struct percpu_data *)~(unsigned long)(pdata) diff --git a/trunk/mm/allocpercpu.c b/trunk/mm/allocpercpu.c index 00b02623f008..7e58322b7134 100644 --- a/trunk/mm/allocpercpu.c +++ b/trunk/mm/allocpercpu.c @@ -98,7 +98,7 @@ EXPORT_SYMBOL_GPL(__percpu_populate_mask); */ void *__percpu_alloc_mask(size_t size, gfp_t gfp, cpumask_t *mask) { - void *pdata = kzalloc(sizeof(struct percpu_data), gfp); + void *pdata = kzalloc(nr_cpu_ids * sizeof(void *), gfp); void *__pdata = __percpu_disguise(pdata); if (unlikely(!pdata))