[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20101206143256.GE3158@balbir.in.ibm.com>
Date: Mon, 6 Dec 2010 20:02:56 +0530
From: Balbir Singh <balbir@...ux.vnet.ibm.com>
To: Christoph Lameter <cl@...ux.com>
Cc: Michael Holzheu <holzheu@...ux.vnet.ibm.com>,
akpm@...ux-foundation.org, Pekka Enberg <penberg@...helsinki.fi>,
linux-kernel@...r.kernel.org,
Eric Dumazet <eric.dumazet@...il.com>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Tejun Heo <tj@...nel.org>, linux-mm@...ck.org
Subject: Re: [thisops uV3 08/18] Taskstats: Use this_cpu_ops
* Christoph Lameter <cl@...ux.com> [2010-12-01 12:13:44]:
> 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).
>
But that breaks current behaviour, we should probably initialize all
of the array to -1?
--
Three Cheers,
Balbir
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists