Skip to contentSkip to conversation

remove preempt workaround in slab.c

PATCH New Robert Love 1 participant 1 message Sep 24, 2002 Memory management

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 remove preempt workaround in slab.c

Linus,

Before the irqs_disabled() check in preempt_schedule(), we worked around some locking issues in slab.c. Now that we will never preempt with interrupts disabled, we can remove those and clean things up.

This is courtesy of Manfred Spraul.

Patch is against current BK, please apply.

Robert Love

mm/slab.c +1 -7
diff -urN linux-2.5.38/mm/slab.c linux/mm/slab.c
@@ -1357,11 +1357,7 @@
 		cc_entry(cc)[cc->avail++] =
 				kmem_cache_alloc_one_tail(cachep, slabp);
 	}
-	/*
-	 * CAREFUL: do not enable preemption yet, the per-CPU
-	 * entries rely on us being atomic.
-	 */
-	_raw_spin_unlock(&cachep->spinlock);
+	spin_unlock(&cachep->spinlock);
 
 	if (cc->avail)
 		return cc_entry(cc)[--cc->avail];
@@ -1389,8 +1385,6 @@
 				STATS_INC_ALLOCMISS(cachep);
 				objp = kmem_cache_alloc_batch(cachep,flags);
 				local_irq_restore(save_flags);
-				/* end of non-preemptible region */
-				preempt_enable();
 				if (!objp)
 					goto alloc_new_slab_nolock;
 				return objp;