lkml.org 
[lkml]   [2010]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [thisops uV3 08/18] Taskstats: Use this_cpu_ops
    On Wed, 1 Dec 2010, Michael Holzheu wrote:

    > > return -ENOMEM;
    > >
    > > if (!info) {
    > > - int seq = get_cpu_var(taskstats_seqnum)++;
    > > - put_cpu_var(taskstats_seqnum);
    > > + int seq = this_cpu_inc_return(taskstats_seqnum);
    >
    > Hmmm, wouldn't seq now always be one more than before?
    >
    > I think that "seq = get_cpu_var(taskstats_seqnum)++" first assigns
    > taskstats_seqnum to seq and then increases the value in contrast to
    > this_cpu_inc_return() that returns the already increased value, correct?

    Correct. We need to subtract one from that (which will eliminate the minus
    -1 that the inline this_cpu_inc_return creates).



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