diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2011-07-25 02:55:42 -0400 |
---|---|---|
committer | Pekka Enberg <penberg@kernel.org> | 2011-07-28 06:40:08 -0400 |
commit | acfe7d74484d6ccb25a80b8ff259fceceac0473e (patch) | |
tree | 0de2cb086983813091e426015e218643016b3bc9 /mm/slab.c | |
parent | 95b6886526bb510b8370b625a49bc0ab3b8ff10f (diff) |
slab: remove one NR_CPUS dependency
Reduce high order allocations in do_tune_cpucache() for some setups.
(NR_CPUS=4096 -> we need 64KB)
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Diffstat (limited to 'mm/slab.c')
-rw-r--r-- | mm/slab.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -3934,7 +3934,7 @@ fail: | |||
3934 | 3934 | ||
3935 | struct ccupdate_struct { | 3935 | struct ccupdate_struct { |
3936 | struct kmem_cache *cachep; | 3936 | struct kmem_cache *cachep; |
3937 | struct array_cache *new[NR_CPUS]; | 3937 | struct array_cache *new[0]; |
3938 | }; | 3938 | }; |
3939 | 3939 | ||
3940 | static void do_ccupdate_local(void *info) | 3940 | static void do_ccupdate_local(void *info) |
@@ -3956,7 +3956,8 @@ static int do_tune_cpucache(struct kmem_cache *cachep, int limit, | |||
3956 | struct ccupdate_struct *new; | 3956 | struct ccupdate_struct *new; |
3957 | int i; | 3957 | int i; |
3958 | 3958 | ||
3959 | new = kzalloc(sizeof(*new), gfp); | 3959 | new = kzalloc(sizeof(*new) + nr_cpu_ids * sizeof(struct array_cache *), |
3960 | gfp); | ||
3960 | if (!new) | 3961 | if (!new) |
3961 | return -ENOMEM; | 3962 | return -ENOMEM; |
3962 | 3963 | ||