Print this page
5045 use atomic_{inc,dec}_* instead of atomic_add_*

@@ -1211,11 +1211,11 @@
         struct cpu *cpup;
 
         ASSERT(SEMA_HELD(&bp->b_sem));
 
         cpup = CPU;
-        atomic_add_64(&cpup->cpu_stats.sys.iowait, 1);
+        atomic_inc_64(&cpup->cpu_stats.sys.iowait);
         DTRACE_IO1(wait__start, struct buf *, bp);
 
         /*
          * In case of panic, busy wait for completion
          */

@@ -1224,11 +1224,11 @@
                         drv_usecwait(10);
         } else
                 sema_p(&bp->b_io);
 
         DTRACE_IO1(wait__done, struct buf *, bp);
-        atomic_add_64(&cpup->cpu_stats.sys.iowait, -1);
+        atomic_dec_64(&cpup->cpu_stats.sys.iowait);
 
         error = geterror(bp);
         if ((bp->b_flags & B_ASYNC) == 0) {
                 if (bp->b_flags & B_REMAPPED)
                         bp_mapout(bp);