Greg Banks wrote: > On Wed, May 23, 2007 at 12:22:44AM -0500, Tom Tucker wrote: >> >> >> On 5/22/07 9:32 PM, "Greg Banks" wrote: >> >>> On Tue, May 22, 2007 at 12:34:23PM -0500, Tom Tucker wrote: >> I need to do a little clean up (e.g. atomic_inc()) and then I'll add them as >> suggested. If there are dissenters, please speak now... > > You should be able to get away with just ++. They're only stats, > it's not like you have logic depending on them being exact. The usual way to do this is to allocate separate stat arrays for each CPU. All the per-CPU arrays are summed only when something wants to display stat totals. That way you can use ++, be fairly sure you will get accurate statistics, and not have to be concerned about CPU cache effects or lock contention.