From 32ffd389449eaa6bb1b16ee95d59c49e204f8c02 Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Sun, 6 May 2007 14:49:03 -0700 Subject: [PATCH] --- yaml --- r: 54174 b: refs/heads/master c: 714b8171af9c930a59a0da8f6fe50518e70ab035 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/mm/slab.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index bccf777e4f2a..a90dc0c6a841 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5f22df00a009e3f86301366c0ecddb63ebd22af9 +refs/heads/master: 714b8171af9c930a59a0da8f6fe50518e70ab035 diff --git a/trunk/mm/slab.c b/trunk/mm/slab.c index 8b71a9c3daa4..21b2aef25254 100644 --- a/trunk/mm/slab.c +++ b/trunk/mm/slab.c @@ -2990,6 +2990,14 @@ static void *cache_alloc_refill(struct kmem_cache *cachep, gfp_t flags) slabp = list_entry(entry, struct slab, list); check_slabp(cachep, slabp); check_spinlock_acquired(cachep); + + /* + * The slab was either on partial or free list so + * there must be at least one object available for + * allocation. + */ + BUG_ON(slabp->inuse < 0 || slabp->inuse >= cachep->num); + while (slabp->inuse < cachep->num && batchcount--) { STATS_INC_ALLOCED(cachep); STATS_INC_ACTIVE(cachep);