percpu: clear memory allocated with the km allocator
authorTejun Heo <tj@kernel.org>
Fri, 10 Sep 2010 08:49:37 +0000 (10:49 +0200)
committerPekka Enberg <penberg@kernel.org>
Sat, 2 Oct 2010 07:28:42 +0000 (10:28 +0300)
Percpu allocator should clear memory before returning it but the km
allocator forgot to do it.  Fix it.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: Peter Zijlstra <peterz@infradead.org>
mm/percpu-km.c

index 7037bc7..89633fe 100644 (file)
 
 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;
 }