lkml.org 
[lkml]   [2010]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] pcrypt: sysfs interface
On Fri, Jul 02, 2010 at 02:20:15PM +0400, Dan Kruchinin wrote:
> >
> > Yes, I thought about something like this. You can still take the sum
> > over the percpu objects when you output the statistics.
>
> But summation can not be clear without some kind of lock because
> while we're summing another CPU can increase or decrease its percpu statistic
> counters. Then each statistic percpu counter must be modified under lock, right?
>

Yes, the counters must accessed under lock. In the fastpath functions you
hold the appropriate lock anyway. Modifying a local percpu value should
not be too painfull there.

The expensive thing is to access the percpu statistics, but this happens
on demand and is probaply a rare event.

Steffen


\
 
 \ /
  Last update: 2010-07-02 13:23    [W:0.225 / U:0.400 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site