[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 4 Apr 2013 13:52:00 +0000
From: Christoph Lameter <cl@...ux.com>
To: Eric Dumazet <eric.dumazet@...il.com>
cc: Tejun Heo <htejun@...il.com>, RongQing Li <roy.qing.li@...il.com>,
Shan Wei <davidshan@...cent.com>, netdev@...r.kernel.org
Subject: Re: [PERCPU] Remove & in front of this_cpu_ptr
On Wed, 3 Apr 2013, Eric Dumazet wrote:
> I agree with you, I prefer &this_cpu_ptr(percpu_pointer)->field
>
> The offset is added after getting the address of the (percpu) base
> object.
There are two offsets being added! percpu_pointer is not a
pointer but an offset. this_cpu_ptr creates a pointer from the
percpu base of the current processor by adding the offset of the percpu
variable. The offset calculation better be in the parenthesis.
The method that I proposed is also conforming with the use of other
this_cpu_ops. F.e. In order to do a read one would need to do
x = this_cpu_read(percpu_pointer->field)
x = this_cpu_read(percpu_pointer)->field
does not work (and does not pass sparse).
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists