lkml.org 
[lkml]   [2010]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [Use cpuops V1 09/11] Connector: Use this_cpu operations
    On 12/06/2010 06:16 PM, Christoph Lameter wrote:
    > get_seq can benefit from this_cpu_operations. Address calculation is avoided
    > and the increment is done using an xadd.
    >
    > Cc: Scott James Remnant <scott@ubuntu.com>
    > Cc: Mike Frysinger <vapier@gentoo.org>
    > Signed-off-by: Christoph Lameter <cl@linux.com>
    >
    > ---
    > drivers/connector/cn_proc.c | 5 +++--
    > 1 file changed, 3 insertions(+), 2 deletions(-)
    >
    > Index: linux-2.6/drivers/connector/cn_proc.c
    > ===================================================================
    > --- linux-2.6.orig/drivers/connector/cn_proc.c 2010-11-30 09:38:33.000000000 -0600
    > +++ linux-2.6/drivers/connector/cn_proc.c 2010-11-30 09:39:38.000000000 -0600
    > @@ -43,9 +43,10 @@ static DEFINE_PER_CPU(__u32, proc_event_
    >
    > static inline void get_seq(__u32 *ts, int *cpu)
    > {
    > - *ts = get_cpu_var(proc_event_counts)++;
    > + preempt_disable();
    > + *ts = __this_cpu_inc(proc_event_counts);

    Eh? __this_cpu_inc() evaluates to the incremented value?

    --
    tejun


    \
     
     \ /
      Last update: 2010-12-07 16:11    [W:4.137 / U:0.084 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site