[dpdk-dev] [PATCH] sched: add 64-bit counter retrieval API

Stephen Hemminger stephen at networkplumber.org
Mon Jul 23 18:52:52 CEST 2018


On Wed, 18 Jul 2018 15:51:39 +0100
alangordondewar at gmail.com wrote:

> From: Alan Dewar <alan.dewar at att.com>
> 
> Add new APIs to retrieve counters in 64-bit wide fields.
> 
> Signed-off-by: Alan Dewar <alan.dewar at att.com>

Do you want to consider 64 bit counter roll over on 32 bit platform?
The problem is that incrementing an 64 bit value is not atomic on
32 bit cpu. The carry operation can race with reading.

The kernel has special case code to do restartable sequence for
accessing 64 bit counter on 32 bit CPU. These functions become
nop's on 64bit.


More information about the dev mailing list