lkml.org 
[lkml]   [2010]   [Oct]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] percpu_counter : add percpu_counter_add_fast()
    On Fri, 22 Oct 2010 00:58:14 +0200
    Eric Dumazet <eric.dumazet@gmail.com> wrote:

    > Then 39 instructions in hot path (no lock taken)

    Wow, your compiler sucks.

    .globl __percpu_counter_add
    .type __percpu_counter_add, @function
    __percpu_counter_add:
    pushq %rbp #
    movq %rsp, %rbp #,
    pushq %r13 #
    movq %rdi, %r13 # fbc, fbc
    pushq %r12 #
    pushq %rbx #
    pushq %r10 #
    movq 96(%rdi), %rbx # <variable>.counters, pcount
    #APP
    movl %gs:cpu_number,%eax # cpu_number, pfo_ret__
    #NO_APP
    cltq
    addq __per_cpu_offset(,%rax,8), %rbx # __per_cpu_offset, pcount
    movslq (%rbx),%rax #* pcount, tmp70
    leaq (%rax,%rsi), %r12 #, count
    movslq %edx,%rax # batch, batch
    cmpq %rax, %r12 # batch, count
    jge .L43 #,
    negl %edx # batch
    movslq %edx,%rax # batch, tmp74
    cmpq %rax, %r12 # tmp74, count
    jg .L45 #,
    .L43:
    movq %r13, %rdi # fbc, D.14396
    call _raw_spin_lock #
    addq %r12, 72(%r13) # count, <variable>.count
    movq %r13, %rdi # fbc, D.14396
    movl $0, (%rbx) #,* pcount
    call _raw_spin_unlock #
    jmp .L47 #
    .L45:
    movl %r12d, (%rbx) # count,* pcount
    .L47:
    popq %r9 #
    popq %rbx #
    popq %r12 #
    popq %r13 #
    leave
    ret



    \
     
     \ /
      Last update: 2010-10-22 01:21    [W:0.021 / U:0.536 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site