]>
Commit | Line | Data |
---|---|---|
cb8b711e GKH |
1 | From f3186a9c51eabe75b2780153ed7f07778d78b16e Mon Sep 17 00:00:00 2001 |
2 | From: Haicheng Li <haicheng.li@linux.intel.com> | |
3 | Date: Wed, 6 Jan 2010 15:25:23 +0800 | |
4 | Subject: slab: initialize unused alien cache entry as NULL at alloc_alien_cache(). | |
5 | ||
6 | From: Haicheng Li <haicheng.li@linux.intel.com> | |
7 | ||
8 | commit f3186a9c51eabe75b2780153ed7f07778d78b16e upstream. | |
9 | ||
10 | Comparing with existing code, it's a simpler way to use kzalloc_node() | |
11 | to ensure that each unused alien cache entry is NULL. | |
12 | ||
13 | CC: Eric Dumazet <eric.dumazet@gmail.com> | |
14 | Acked-by: Andi Kleen <ak@linux.intel.com> | |
15 | Acked-by: Christoph Lameter <cl@linux-foundation.org> | |
16 | Acked-by: Matt Mackall <mpm@selenic.com> | |
17 | Signed-off-by: Haicheng Li <haicheng.li@linux.intel.com> | |
18 | Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi> | |
19 | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> | |
20 | ||
21 | --- | |
22 | mm/slab.c | 6 ++---- | |
23 | 1 file changed, 2 insertions(+), 4 deletions(-) | |
24 | ||
25 | --- a/mm/slab.c | |
26 | +++ b/mm/slab.c | |
27 | @@ -971,13 +971,11 @@ static struct array_cache **alloc_alien_ | |
28 | ||
29 | if (limit > 1) | |
30 | limit = 12; | |
31 | - ac_ptr = kmalloc_node(memsize, gfp, node); | |
32 | + ac_ptr = kzalloc_node(memsize, gfp, node); | |
33 | if (ac_ptr) { | |
34 | for_each_node(i) { | |
35 | - if (i == node || !node_online(i)) { | |
36 | - ac_ptr[i] = NULL; | |
37 | + if (i == node || !node_online(i)) | |
38 | continue; | |
39 | - } | |
40 | ac_ptr[i] = alloc_arraycache(node, limit, 0xbaadf00d, gfp); | |
41 | if (!ac_ptr[i]) { | |
42 | for (i--; i >= 0; i--) |