kernel -- lwbuf: Convert cmpxchg loop to LOCK OR; we are just setting a bit.
authorVenkatesh Srinivas <me@endeavour.zapto.org>
Tue, 25 Oct 2011 17:48:20 +0000 (10:48 -0700)
committerVenkatesh Srinivas <me@endeavour.zapto.org>
Tue, 25 Oct 2011 17:48:20 +0000 (10:48 -0700)
sys/cpu/i386/misc/lwbuf.c

index 5decd98..c0c1312 100644 (file)
@@ -157,14 +157,9 @@ lwbuf_set_global(struct lwbuf *lwb)
 static vm_offset_t
 _lwbuf_kva(struct lwbuf *lwb, struct mdglobaldata *gd)
 {
-    cpumask_t old, new;
-
     pmap_kenter_sync_quick(lwb->kva);
 
-    do {
-        old = lwb->cpumask;
-        new = old | gd->mi.gd_cpumask;
-    } while (atomic_cmpset_int(&lwb->cpumask, old, new) == 0);
+    atomic_set_int(&lwb->cpumask, gd->mi.gd_cpumask);
 
     return (lwb->kva);
 }