提交 61c03ddb 编写于 作者: A Anton Blanchard 提交者: Benjamin Herrenschmidt

powerpc: Replace per_cpu(, smp_processor_id()) with __get_cpu_var()

The cputime code has a few places that do per_cpu(, smp_processor_id()).
Replace them with __get_cpu_var().
Signed-off-by: NAnton Blanchard <anton@samba.org>
Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
上级 4ba525d1
...@@ -73,10 +73,9 @@ static inline unsigned long cputime_to_jiffies(const cputime_t ct) ...@@ -73,10 +73,9 @@ static inline unsigned long cputime_to_jiffies(const cputime_t ct)
static inline cputime_t cputime_to_scaled(const cputime_t ct) static inline cputime_t cputime_to_scaled(const cputime_t ct)
{ {
if (cpu_has_feature(CPU_FTR_SPURR) && if (cpu_has_feature(CPU_FTR_SPURR) &&
per_cpu(cputime_last_delta, smp_processor_id())) __get_cpu_var(cputime_last_delta))
return ct * return ct * __get_cpu_var(cputime_scaled_last_delta) /
per_cpu(cputime_scaled_last_delta, smp_processor_id())/ __get_cpu_var(cputime_last_delta);
per_cpu(cputime_last_delta, smp_processor_id());
return ct; return ct;
} }
......
...@@ -265,8 +265,8 @@ void account_system_vtime(struct task_struct *tsk) ...@@ -265,8 +265,8 @@ void account_system_vtime(struct task_struct *tsk)
account_system_time(tsk, 0, delta, deltascaled); account_system_time(tsk, 0, delta, deltascaled);
else else
account_idle_time(delta); account_idle_time(delta);
per_cpu(cputime_last_delta, smp_processor_id()) = delta; __get_cpu_var(cputime_last_delta) = delta;
per_cpu(cputime_scaled_last_delta, smp_processor_id()) = deltascaled; __get_cpu_var(cputime_scaled_last_delta) = deltascaled;
local_irq_restore(flags); local_irq_restore(flags);
} }
EXPORT_SYMBOL_GPL(account_system_vtime); EXPORT_SYMBOL_GPL(account_system_vtime);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册