xen: Use this_cpu_ops
Use this_cpu_ops to reduce code size and simplify things in various places. V3->V4: Move instance of this_cpu_inc_return to a later patchset so that this patch can be applied without infrastructure changes. Cc: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> 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:
committed by
Tejun Heo
parent
c7b92516a9
commit
780f36d8b3
@@ -135,24 +135,24 @@ static void do_stolen_accounting(void)
|
||||
|
||||
/* Add the appropriate number of ticks of stolen time,
|
||||
including any left-overs from last time. */
|
||||
stolen = runnable + offline + __get_cpu_var(xen_residual_stolen);
|
||||
stolen = runnable + offline + __this_cpu_read(xen_residual_stolen);
|
||||
|
||||
if (stolen < 0)
|
||||
stolen = 0;
|
||||
|
||||
ticks = iter_div_u64_rem(stolen, NS_PER_TICK, &stolen);
|
||||
__get_cpu_var(xen_residual_stolen) = stolen;
|
||||
__this_cpu_write(xen_residual_stolen, stolen);
|
||||
account_steal_ticks(ticks);
|
||||
|
||||
/* Add the appropriate number of ticks of blocked time,
|
||||
including any left-overs from last time. */
|
||||
blocked += __get_cpu_var(xen_residual_blocked);
|
||||
blocked += __this_cpu_read(xen_residual_blocked);
|
||||
|
||||
if (blocked < 0)
|
||||
blocked = 0;
|
||||
|
||||
ticks = iter_div_u64_rem(blocked, NS_PER_TICK, &blocked);
|
||||
__get_cpu_var(xen_residual_blocked) = blocked;
|
||||
__this_cpu_write(xen_residual_blocked, blocked);
|
||||
account_idle_ticks(ticks);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user