lkml.org 
[lkml]   [2010]   [Sep]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH percpu#for-next] percpu: clear memory allocated with the km allocator
From
Date
On Fri, 2010-09-10 at 10:52 +0200, Tejun Heo wrote:
> 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>
> Spotted-by: Peter Zijlstra <peterz@infradead.org>

(fwiw, -tip uses Reported-by)

Acked-by: Peter Zijlstra <peterz@infradead.org>

> ---
> 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;
> }
>




\
 
 \ /
  Last update: 2010-09-10 10:57    [W:0.078 / U:0.688 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site