[PATCH percpu#for-next] percpu: clear memory allocated with the kmallocator

From: Tejun Heo
Date: Fri Sep 10 2010 - 04:52:40 EST


Percpu allocator should clear memory before returning it but the km
allocator forgot to do it. Fix it.

Signed-off-by: Tejun Heo <tj@xxxxxxxxxx>
Spotted-by: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
---
mm/percpu-km.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/mm/percpu-km.c b/mm/percpu-km.c
index 7037bc7..89633fe 100644
--- a/mm/percpu-km.c
+++ b/mm/percpu-km.c
@@ -35,7 +35,11 @@

static int pcpu_populate_chunk(struct pcpu_chunk *chunk, int off, int size)
{
- /* noop */
+ unsigned int cpu;
+
+ for_each_possible_cpu(cpu)
+ memset((void *)pcpu_chunk_addr(chunk, cpu, 0) + off, 0, size);
+
return 0;
}

--
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/