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

*** 1412,1431 **** * 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); 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); } /*ARGSUSED*/ static int memscrub_mem_config_pre_del( --- 1412,1431 ---- * 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_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_dec_32(&pause_memscrub); } /*ARGSUSED*/ static int memscrub_mem_config_pre_del(
*** 1448,1469 **** * 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); 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); } static kphysm_setup_vector_t memscrub_mem_config_vec = { KPHYSM_SETUP_VECTOR_VERSION, memscrub_mem_config_post_add, --- 1448,1469 ---- * 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_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_dec_32(&pause_memscrub); } static kphysm_setup_vector_t memscrub_mem_config_vec = { KPHYSM_SETUP_VECTOR_VERSION, memscrub_mem_config_post_add,