printf("BO cache: %zu KiB (+%zu KiB from %s, hit/miss %" PRIu64
"/%" PRIu64 ")\n",
DIV_ROUND_UP(dev->bo_cache.size, 1024),
- DIV_ROUND_UP(bo->size, 1024), bo->label, dev->bo_cache.hits,
- dev->bo_cache.misses);
+ DIV_ROUND_UP(bo->size, 1024), bo->label,
+ p_atomic_read(&dev->bo_cache.hits),
+ p_atomic_read(&dev->bo_cache.misses));
}
/* Update label for debug */
/* Update stats based on the first attempt to fetch */
if (bo != NULL)
- dev->bo_cache.hits++;
+ p_atomic_inc(&dev->bo_cache.hits);
else
- dev->bo_cache.misses++;
+ p_atomic_inc(&dev->bo_cache.misses);
/* Otherwise, allocate a fresh BO. If allocation fails, we can try waiting
* for something in the cache. But if there's no nothing suitable, we should