Re: [my_cpu_ptr 1/5] Introduce my_cpu_ptr()

Christoph Lameter
2009-05-28T16:00:06Z

On Thu, 28 May 2009, Rusty Russell wrote:

> On Thu, 28 May 2009 03:16:59 am cl@linux-foundation.org wrote:
> > my_cpu_ptr(xx) = per_cpu_ptr(xx, smp_processor_id).
>
> I had this implemented earlier as as get_cpu_ptr()/__get_cpu_ptr(), to match
> get_cpu_var() / __get_cpu_var().

Have not seen it but it would be a bit confusing since
we already have get_cpu* which must be paired with put_cpu*
because of the refcount taking (get_cpu_var and get_cpu).
get_cpu_ptr() would not have to be paired.

Better use a different name.

my_cpu_ptr came from my_cpu_offset:

#define my_cpu_ptr(ptr) SHIFT_PERCPU_PTR(ptr, my_cpu_offset)
#define __my_cpu_ptr(ptr) SHIFT_PERCPU_PTR(ptr, __my_cpu_offset)