Skip to contentSkip to conversation

aa-170-drain_cpu_caches

PATCH Andrew Morton 1 participant 1 message Mar 20, 2002 Memory management

lore
Share & tools
lore
#0 lore raw

A performance tweak (I guess): perform the cross-CPU cache reclaim operation outside the global semaphore. Needs more explanation.

=====================================

mm/slab.c renamed from mm/slab.c~aa-170-drain_cpu_caches +2 -2
@@ -916,8 +916,6 @@ static int __kmem_cache_shrink(kmem_cach
 	slab_t *slabp;
 	int ret;
 
-	drain_cpu_caches(cachep);
-
 	spin_lock_irq(&cachep->spinlock);
 
 	/* If the cache is growing, stop shrinking. */
@@ -987,6 +985,8 @@ int kmem_cache_destroy (kmem_cache_t * c
 						kmem_cache_t, next);
 	list_del(&cachep->next);
 	up(&cache_chain_sem);
+
+	drain_cpu_caches(cachep);
 
 	if (__kmem_cache_shrink(cachep)) {
 		printk(KERN_ERR "kmem_cache_destroy: Can't free all objects %p\n",

-