diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-04-19 04:00:00 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-04-19 04:00:00 +0000 |
commit | 46e045034336a2cc90c1798cd7cc07af744ddfd6 (patch) | |
tree | 3b9b51fc482e729f663d25333e77fbed9aaa939a /mm/slab.c | |
parent | 31dc59d503a02e84c4de98826452acaeb56dc15a (diff) |
Merge with Linux 2.3.99-pre4.
Diffstat (limited to 'mm/slab.c')
-rw-r--r-- | mm/slab.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -132,7 +132,7 @@ * SLAB_SELFTEST - 1 to perform a few tests, mainly for development. */ #define SLAB_MGMT_CHECKS 1 -#define SLAB_DEBUG_SUPPORT 0 +#define SLAB_DEBUG_SUPPORT 1 #define SLAB_STATS 0 #define SLAB_SELFTEST 0 @@ -1024,6 +1024,16 @@ static int __kmem_cache_shrink(kmem_cache_t *cachep) slabp = cachep->c_lastp; if (slabp->s_inuse || slabp == kmem_slab_end(cachep)) break; + /* + * If this slab is the first slab with free objects + * (c_freep), and as we are walking the slab chain + * backwards, it is also the last slab with free + * objects. After unlinking it, there will be no + * slabs with free objects, so point c_freep into the + * cache structure. + */ + if (cachep->c_freep == slabp) + cachep->c_freep = kmem_slab_end(cachep); kmem_slab_unlink(slabp); spin_unlock_irq(&cachep->c_spinlock); kmem_slab_destroy(cachep, slabp); |