Skip to content

Commit

Permalink
[POWERPC] Use __get_cpu_var in time.c
Browse files Browse the repository at this point in the history
Use __get_cpu_var(x) instead of per_cpu(x, smp_processor_id()), as it
is optimized on ppc64 to access the current cpu's per-cpu offset directly;
it's local_paca.offset instead of TOC->paca[local_paca->processor_id].offset.

This is the trivial portion, two functions with one use each.

Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Milton Miller authored and Paul Mackerras committed Dec 20, 2007
1 parent c481887 commit 8b5621f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/powerpc/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ void calculate_steal_time(void)

if (!cpu_has_feature(CPU_FTR_PURR))
return;
pme = &per_cpu(cpu_purr_data, smp_processor_id());
pme = &__get_cpu_var(cpu_purr_data);
if (!pme->initialized)
return; /* this can happen in early boot */
tb = mftb();
Expand All @@ -352,7 +352,7 @@ static void snapshot_purr(void)
if (!cpu_has_feature(CPU_FTR_PURR))
return;
local_irq_save(flags);
pme = &per_cpu(cpu_purr_data, smp_processor_id());
pme = &__get_cpu_var(cpu_purr_data);
pme->tb = mftb();
pme->purr = mfspr(SPRN_PURR);
pme->initialized = 1;
Expand Down

0 comments on commit 8b5621f

Please sign in to comment.