Re: [PATCH] this_cpu: Use this_cpu_xx in trace_functions_graph.c
From: Christoph Lameter
Date: Tue Oct 13 2009 - 11:23:09 EST
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-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/