Quantcast
Channel: Active questions tagged kernel - Stack Overflow
Viewing all articles
Browse latest Browse all 6334

Read a percpu_ref count without changing it to single shared atomic_t counter

$
0
0

Lets say I have a percpu_ref structure which I had initialized and have been using, you know put and get on it.

Is it possible to do a read on the count? Something like,

atomic_long_read(&this_percpu_ref.count);

Because of the way percpu_ref structures are, (per-CPU array of reference counters), doing a read would mean that it has to sum up the count of all those counters, which would then cause cache-line bouncing.


Viewing all articles
Browse latest Browse all 6334

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>