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

@@ -1356,13 +1356,13 @@
                     kthread_t *new)
 {
         pg_cmt_t        *cmt_pg = (pg_cmt_t *)pg;
 
         if (old == cp->cpu_idle_thread) {
-                atomic_add_32(&cmt_pg->cmt_utilization, 1);
+                atomic_inc_32(&cmt_pg->cmt_utilization);
         } else if (new == cp->cpu_idle_thread) {
-                atomic_add_32(&cmt_pg->cmt_utilization, -1);
+                atomic_dec_32(&cmt_pg->cmt_utilization);
         }
 }
 
 /*
  * Macro to test whether a thread is currently runnable on a CPU in a PG.

@@ -1381,11 +1381,11 @@
         cpupm_domain_t  *dom;
         uint32_t        u;
 
         if (old == cp->cpu_idle_thread) {
                 ASSERT(new != cp->cpu_idle_thread);
-                u = atomic_add_32_nv(&cmt->cmt_utilization, 1);
+                u = atomic_inc_32_nv(&cmt->cmt_utilization);
                 if (u == 1) {
                         /*
                          * Notify the CPU power manager that the domain
                          * is non-idle.
                          */

@@ -1393,11 +1393,11 @@
                         cpupm_utilization_event(cp, now, dom,
                             CPUPM_DOM_BUSY_FROM_IDLE);
                 }
         } else if (new == cp->cpu_idle_thread) {
                 ASSERT(old != cp->cpu_idle_thread);
-                u = atomic_add_32_nv(&cmt->cmt_utilization, -1);
+                u = atomic_dec_32_nv(&cmt->cmt_utilization);
                 if (u == 0) {
                         /*
                          * The domain is idle, notify the CPU power
                          * manager.
                          *