diff options
author | Haicheng Li <haicheng.li@linux.intel.com> | 2010-01-06 02:25:23 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-15 12:05:55 -0400 |
commit | 0b7196b95e817ca95d15842269167324734c1c0e (patch) | |
tree | a02025e309f268dcb82d7bd0915864af9b0b291b /mm | |
parent | f6bbb1be3901ce3c9166ef541bee8d47cba5d3fc (diff) |
slab: initialize unused alien cache entry as NULL at alloc_alien_cache().
commit f3186a9c51eabe75b2780153ed7f07778d78b16e upstream.
Comparing with existing code, it's a simpler way to use kzalloc_node()
to ensure that each unused alien cache entry is NULL.
CC: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Christoph Lameter <cl@linux-foundation.org>
Acked-by: Matt Mackall <mpm@selenic.com>
Signed-off-by: Haicheng Li <haicheng.li@linux.intel.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/slab.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -983,13 +983,11 @@ static struct array_cache **alloc_alien_cache(int node, int limit, gfp_t gfp) | |||
983 | 983 | ||
984 | if (limit > 1) | 984 | if (limit > 1) |
985 | limit = 12; | 985 | limit = 12; |
986 | ac_ptr = kmalloc_node(memsize, gfp, node); | 986 | ac_ptr = kzalloc_node(memsize, gfp, node); |
987 | if (ac_ptr) { | 987 | if (ac_ptr) { |
988 | for_each_node(i) { | 988 | for_each_node(i) { |
989 | if (i == node || !node_online(i)) { | 989 | if (i == node || !node_online(i)) |
990 | ac_ptr[i] = NULL; | ||
991 | continue; | 990 | continue; |
992 | } | ||
993 | ac_ptr[i] = alloc_arraycache(node, limit, 0xbaadf00d, gfp); | 991 | ac_ptr[i] = alloc_arraycache(node, limit, 0xbaadf00d, gfp); |
994 | if (!ac_ptr[i]) { | 992 | if (!ac_ptr[i]) { |
995 | for (i--; i >= 0; i--) | 993 | for (i--; i >= 0; i--) |