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

*** 1211,1221 **** struct cpu *cpup; ASSERT(SEMA_HELD(&bp->b_sem)); cpup = CPU; ! atomic_add_64(&cpup->cpu_stats.sys.iowait, 1); DTRACE_IO1(wait__start, struct buf *, bp); /* * In case of panic, busy wait for completion */ --- 1211,1221 ---- struct cpu *cpup; ASSERT(SEMA_HELD(&bp->b_sem)); cpup = CPU; ! atomic_inc_64(&cpup->cpu_stats.sys.iowait); DTRACE_IO1(wait__start, struct buf *, bp); /* * In case of panic, busy wait for completion */
*** 1224,1234 **** 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); error = geterror(bp); if ((bp->b_flags & B_ASYNC) == 0) { if (bp->b_flags & B_REMAPPED) bp_mapout(bp); --- 1224,1234 ---- drv_usecwait(10); } else sema_p(&bp->b_io); DTRACE_IO1(wait__done, struct buf *, bp); ! 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);