Re: [PATCH] this_cpu: Use this_cpu_xx in trace_functions_graph.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 13 Oct 2009, Tejun Heo wrote:

> > For this_cpu_ptr / __this_cpu_ptr it does not matter. this_cpu_ptr gives
> > you additional checks.
>
> Yes, you're right.  The naming scheme in percpu sucks really hard.
> The subtle differences among [__]get_cpu_var(), [__]this_cpu_ptr() and
> other this_cpu ops.  Arghhhhhh.......

Yeah. __this_cpu_ptr is safe to use in preempt / irq disable sections
though the same way as __this_cpu_add/dec etc.

(__)get_cpu_var can be mostly gotten rid off through __this_cpu
operations.

We could define __get_cpu_var and get_cpu_var using this_cpu

#define get_cpu_var(x) (get_cpu(); this_cpu_read(per_cpu_var(x))

#define __get_cpu_var __this_cpu_read(per_cpu_var(x))


--
To unsubscribe from this list: send the line "unsubscribe linux-next" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Linux USB Development]     [Yosemite News]     [Linux SCSI]

  Powered by Linux