Print this page
5042 stop using deprecated atomic functions

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/os/kmem.c
          +++ new/usr/src/uts/common/os/kmem.c
↓ open down ↓ 3158 lines elided ↑ open up ↑
3159 3159          if (!taskq_dispatch(kmem_taskq, kmem_reap_done, flag, TQ_NOSLEEP))
3160 3160                  kmem_reap_done(flag);
3161 3161  }
3162 3162  
3163 3163  static void
3164 3164  kmem_reap_common(void *flag_arg)
3165 3165  {
3166 3166          uint32_t *flag = (uint32_t *)flag_arg;
3167 3167  
3168 3168          if (MUTEX_HELD(&kmem_cache_lock) || kmem_taskq == NULL ||
3169      -            cas32(flag, 0, 1) != 0)
     3169 +            atomic_cas_32(flag, 0, 1) != 0)
3170 3170                  return;
3171 3171  
3172 3172          /*
3173 3173           * It may not be kosher to do memory allocation when a reap is called
3174 3174           * is called (for example, if vmem_populate() is in the call chain).
3175 3175           * So we start the reap going with a TQ_NOALLOC dispatch.  If the
3176 3176           * dispatch fails, we reset the flag, and the next reap will try again.
3177 3177           */
3178 3178          if (!taskq_dispatch(kmem_taskq, kmem_reap_start, flag, TQ_NOALLOC))
3179 3179                  *flag = 0;
↓ open down ↓ 2408 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX