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

@@ -1412,20 +1412,20 @@
          * will force the memscrubber to sleep, allowing the DR callback
          * thread to acquire memscrub_lock in new_memscrub(). The use of
          * atomic_add_32() allows concurrent memory DR operations to use the
          * callbacks safely.
          */
-        atomic_add_32(&pause_memscrub, 1);
+        atomic_inc_32(&pause_memscrub);
         ASSERT(pause_memscrub != 0);
 
         /*
          * "Don't care" if we are not scrubbing new memory.
          */
         (void) new_memscrub(0);         /* retain page retire list */
 
         /* Restore the pause setting. */
-        atomic_add_32(&pause_memscrub, -1);
+        atomic_dec_32(&pause_memscrub);
 }
 
 /*ARGSUSED*/
 static int
 memscrub_mem_config_pre_del(

@@ -1448,22 +1448,22 @@
          * will force the memscrubber to sleep, allowing the DR callback
          * thread to acquire memscrub_lock in new_memscrub(). The use of
          * atomic_add_32() allows concurrent memory DR operations to use the
          * callbacks safely.
          */
-        atomic_add_32(&pause_memscrub, 1);
+        atomic_inc_32(&pause_memscrub);
         ASSERT(pause_memscrub != 0);
 
         /*
          * Must stop scrubbing deleted memory as it may be disconnected.
          */
         if (new_memscrub(1)) {  /* update page retire list */
                 disable_memscrub = 1;
         }
 
         /* Restore the pause setting. */
-        atomic_add_32(&pause_memscrub, -1);
+        atomic_dec_32(&pause_memscrub);
 }
 
 static kphysm_setup_vector_t memscrub_mem_config_vec = {
         KPHYSM_SETUP_VECTOR_VERSION,
         memscrub_mem_config_post_add,