lkml.org 
[lkml]   [2010]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [cpuops inc_return V1 8/9] random: Use this_cpu_inc_return
    From
    Date
    On Mon, 2010-12-06 at 11:40 -0600, Christoph Lameter wrote:
    > plain text document attachment (cpuops_inc_return_random)
    > __this_cpu_inc can create a single instruction to do the same as
    > __get_cpu_var()++.

    > - (__get_cpu_var(trickle_count)++ & 0xfff))
    > + ((__this_cpu_inc_return(trickle_count) - 1) & 0xfff))

    I see you've added a "- 1" to mimic the post-increment ++ semantic.

    The goal of this code to add only 1 sample in every 4096, but we don't
    really care which, so this semantic isn't actually important here.

    --
    Mathematics is the supreme nostalgia of our time.




    \
     
     \ /
      Last update: 2010-12-06 19:13    [W:2.896 / U:0.168 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site