Re: [Use cpuops V1 06/11] drivers: Replace __get_cpu_var with __this_cpu_readif not used for an address.

From: Tejun Heo
Date: Tue Dec 07 2010 - 09:32:48 EST


On 12/06/2010 06:16 PM, Christoph Lameter wrote:
> __get_cpu_var() can be replaced with this_cpu_read and will then use a single
> read instruction with implied address calculation to access the correct per cpu
> instance.
>
> However, the address of a per cpu variable passed to __this_cpu_read() cannot be
> determed (since its an implied address conversion through segment prefixes).
> Therefore apply this only to uses of __get_cpu_var where the addres of the
> variable is not used.
>
> V3->V4:
> - Move one instance of this_cpu_inc_return to a later patch
> so that this one can go in without percpu infrastructrure
> changes.
>
> Cc: Neil Horman <nhorman@xxxxxxxxxxxxx>
> Cc: Martin Schwidefsky <schwidefsky@xxxxxxxxxx>
> Signed-off-by: Christoph Lameter <cl@xxxxxxxxx>

applied.

--
tejun
--
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/