1 From: Miklos Szeredi <mszeredi@suse.cz>
2 Subject: Fix use of uninitialized variable in cache_grow()
6 This fixes a bug in SoN-08-reserve-slub.patch.
8 If cache_grow() was called with objp != NULL then the 'reserve' local
9 variable wasn't initialized. This resulted in ac->reserve being set to
10 a rubbish value. Due to this in some circumstances huge amounts of
11 slab pages were allocated (due to slab_force_alloc() returning true),
12 which caused atomic page allocation failures and slowdown of the
15 Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
18 1 file changed, 3 insertions(+), 2 deletions(-)
20 Index: linux-2.6.27/mm/slab.c
21 ===================================================================
22 --- linux-2.6.27.orig/mm/slab.c 2008-12-03 22:11:12.000000000 +0100
23 +++ linux-2.6.27/mm/slab.c 2008-12-03 22:14:37.000000000 +0100
24 @@ -2785,7 +2785,7 @@ static int cache_grow(struct kmem_cache
27 struct kmem_list3 *l3;
32 * Be lazy and only check for valid flags here, keeping it out of the
33 @@ -2841,7 +2841,8 @@ static int cache_grow(struct kmem_cache
34 if (local_flags & __GFP_WAIT)
37 - slab_set_reserve(cachep, reserve);
39 + slab_set_reserve(cachep, reserve);
40 spin_lock(&l3->list_lock);
42 /* Make slab active. */