Skip to content

Commit

Permalink
perf, amd: Use kmalloc_node(,__GFP_ZERO) for northbridge structure al…
Browse files Browse the repository at this point in the history
…location

Jasper suggested we use the zeroing capability of the allocators
instead of calling memset ourselves. Add node affinity while we're at
it.

Reported-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Nov 10, 2010
1 parent eed0152 commit 034c6ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/x86/kernel/cpu/perf_event_amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,11 @@ static struct amd_nb *amd_alloc_nb(int cpu, int nb_id)
struct amd_nb *nb;
int i;

nb = kmalloc(sizeof(struct amd_nb), GFP_KERNEL);
nb = kmalloc_node(sizeof(struct amd_nb), GFP_KERNEL | __GFP_ZERO,
cpu_to_node(cpu));
if (!nb)
return NULL;

memset(nb, 0, sizeof(*nb));
nb->nb_id = nb_id;

/*
Expand Down

0 comments on commit 034c6ef

Please sign in to comment.