aboutsummaryrefslogtreecommitdiffstats
path: root/mm/allocpercpu.c
diff options
context:
space:
mode:
authorEric Dumazet <dada1@cosmosbay.com>2008-02-06 04:37:01 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-06 13:41:04 -0500
commitb3242151906372f30f57feaa43b4cac96a23edb1 (patch)
treed258219aa13dfeae8d9fb5db1fd220a0664a680d /mm/allocpercpu.c
parente7ca2d41a029577a8cff453d1445951d4f96bfd8 (diff)
PERCPU : __percpu_alloc_mask() can dynamically size percpu_data storage
Instead of allocating a fix sized array of NR_CPUS pointers for percpu_data, we can use nr_cpu_ids, which is generally < NR_CPUS. Signed-off-by: Eric Dumazet <dada1@cosmosbay.com> Cc: Christoph Lameter <clameter@sgi.com> Cc: "David S. Miller" <davem@davemloft.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/allocpercpu.c')
-rw-r--r--mm/allocpercpu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/allocpercpu.c b/mm/allocpercpu.c
index 00b02623f008..7e58322b7134 100644
--- a/mm/allocpercpu.c
+++ b/mm/allocpercpu.c
@@ -98,7 +98,7 @@ EXPORT_SYMBOL_GPL(__percpu_populate_mask);
98 */ 98 */
99void *__percpu_alloc_mask(size_t size, gfp_t gfp, cpumask_t *mask) 99void *__percpu_alloc_mask(size_t size, gfp_t gfp, cpumask_t *mask)
100{ 100{
101 void *pdata = kzalloc(sizeof(struct percpu_data), gfp); 101 void *pdata = kzalloc(nr_cpu_ids * sizeof(void *), gfp);
102 void *__pdata = __percpu_disguise(pdata); 102 void *__pdata = __percpu_disguise(pdata);
103 103
104 if (unlikely(!pdata)) 104 if (unlikely(!pdata))