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

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/vm/seg_kmem.c
          +++ new/usr/src/uts/common/vm/seg_kmem.c
↓ open down ↓ 1269 lines elided ↑ open up ↑
1270 1270                  ulong_t *lpthrtp = &lpcb->lp_throttle;
1271 1271                  ulong_t lpthrt = *lpthrtp;
1272 1272                  int     dowakeup = 0;
1273 1273                  int     doalloc = 1;
1274 1274  
1275 1275                  ASSERT(kmem_lp_arena != NULL);
1276 1276                  ASSERT(asize >= size);
1277 1277  
1278 1278                  if (lpthrt != 0) {
1279 1279                          /* try to update the throttle value */
1280      -                        lpthrt = atomic_add_long_nv(lpthrtp, 1);
     1280 +                        lpthrt = atomic_inc_ulong_nv(lpthrtp);
1281 1281                          if (lpthrt >= segkmem_lpthrottle_max) {
1282 1282                                  lpthrt = atomic_cas_ulong(lpthrtp, lpthrt,
1283 1283                                      segkmem_lpthrottle_max / 4);
1284 1284                          }
1285 1285  
1286 1286                          /*
1287 1287                           * when we get above throttle start do an exponential
1288 1288                           * backoff at trying large pages and reaping
1289 1289                           */
1290 1290                          if (lpthrt > segkmem_lpthrottle_start &&
↓ open down ↓ 355 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX