Commit db3801a8 authored by Milton Miller's avatar Milton Miller Committed by Paul Mackerras

[POWERPC] Depend on ->initialized in calc_steal_time

If CPU_FTR_PURR is not set, we will never set cpu_purr_data->initialized.
Checking via __get_cpu_var on 64 bit avoids one dependent load compared
to cpu_has_feature in the not-present case, and is always required when
it is present.  The code is under CONFIG_VIRT_CPU_ACCOUNTING so 32 bit
will not be affected.
Signed-off-by: default avatarMilton Miller <miltonm@bga.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 6e6b44e8
...@@ -329,11 +329,9 @@ void calculate_steal_time(void) ...@@ -329,11 +329,9 @@ void calculate_steal_time(void)
s64 stolen; s64 stolen;
struct cpu_purr_data *pme; struct cpu_purr_data *pme;
if (!cpu_has_feature(CPU_FTR_PURR))
return;
pme = &__get_cpu_var(cpu_purr_data); pme = &__get_cpu_var(cpu_purr_data);
if (!pme->initialized) if (!pme->initialized)
return; /* this can happen in early boot */ return; /* !CPU_FTR_PURR or early in early boot */
tb = mftb(); tb = mftb();
purr = mfspr(SPRN_PURR); purr = mfspr(SPRN_PURR);
stolen = (tb - pme->tb) - (purr - pme->purr); stolen = (tb - pme->tb) - (purr - pme->purr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment