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

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/os/bio.c
          +++ new/usr/src/uts/common/os/bio.c
↓ open down ↓ 1205 lines elided ↑ open up ↑
1206 1206   */
1207 1207  int
1208 1208  biowait(struct buf *bp)
1209 1209  {
1210 1210          int error = 0;
1211 1211          struct cpu *cpup;
1212 1212  
1213 1213          ASSERT(SEMA_HELD(&bp->b_sem));
1214 1214  
1215 1215          cpup = CPU;
1216      -        atomic_add_64(&cpup->cpu_stats.sys.iowait, 1);
     1216 +        atomic_inc_64(&cpup->cpu_stats.sys.iowait);
1217 1217          DTRACE_IO1(wait__start, struct buf *, bp);
1218 1218  
1219 1219          /*
1220 1220           * In case of panic, busy wait for completion
1221 1221           */
1222 1222          if (panicstr) {
1223 1223                  while ((bp->b_flags & B_DONE) == 0)
1224 1224                          drv_usecwait(10);
1225 1225          } else
1226 1226                  sema_p(&bp->b_io);
1227 1227  
1228 1228          DTRACE_IO1(wait__done, struct buf *, bp);
1229      -        atomic_add_64(&cpup->cpu_stats.sys.iowait, -1);
     1229 +        atomic_dec_64(&cpup->cpu_stats.sys.iowait);
1230 1230  
1231 1231          error = geterror(bp);
1232 1232          if ((bp->b_flags & B_ASYNC) == 0) {
1233 1233                  if (bp->b_flags & B_REMAPPED)
1234 1234                          bp_mapout(bp);
1235 1235          }
1236 1236          return (error);
1237 1237  }
1238 1238  
1239 1239  static void
↓ open down ↓ 844 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX