x86: Use this_cpu_ops to optimize code

Go through x86 code and replace __get_cpu_var and get_cpu_var
instances that refer to a scalar and are not used for address
determinations.

Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>
Acked-by: Tejun Heo <tj@kernel.org>
Acked-by: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
Tejun Heo
2010-12-18 16:28:55 +01:00
parent 7c83912062
commit 0a3aee0da4
16 changed files with 57 additions and 62 deletions

View File

@@ -167,9 +167,9 @@ static void ftrace_mod_code(void)
void ftrace_nmi_enter(void)
{
__get_cpu_var(save_modifying_code) = modifying_code;
__this_cpu_write(save_modifying_code, modifying_code);
if (!__get_cpu_var(save_modifying_code))
if (!__this_cpu_read(save_modifying_code))
return;
if (atomic_inc_return(&nmi_running) & MOD_CODE_WRITE_FLAG) {
@@ -183,7 +183,7 @@ void ftrace_nmi_enter(void)
void ftrace_nmi_exit(void)
{
if (!__get_cpu_var(save_modifying_code))
if (!__this_cpu_read(save_modifying_code))
return;
/* Finish all executions before clearing nmi_running */