From: Milton Miller <miltonm@bga.com>
To: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@ozlabs.org
Subject: [PATCH 3/6] use __get_cpu_var in time.c
Date: Thu, 13 Dec 2007 22:52:10 -0600 (CST) [thread overview]
Message-ID: <mm-cpu-3@bga.com> (raw)
In-Reply-To: <mm-cpu-0@bga.com>
use __get_cpu_var(x) instead of per_cpu(x, smp_processor_id()), as it
is optimied on ppc64 to access the current cpus per-cpu offset directly.
Its 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>
---
Index: kernel/arch/powerpc/kernel/time.c
===================================================================
--- kernel.orig/arch/powerpc/kernel/time.c 2007-12-13 20:37:03.000000000 -0600
+++ kernel/arch/powerpc/kernel/time.c 2007-12-13 20:37:03.000000000 -0600
@@ -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();
@@ -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;
next prev parent reply other threads:[~2007-12-14 4:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-14 4:51 [PATCH 0/6] xics.c and time.c optimizations Milton Miller
2007-12-14 4:52 ` [PATCH 1/6] push down or eliminate smp_processor_id in xics Milton Miller
2007-12-14 4:52 ` Milton Miller [this message]
2007-12-14 4:52 ` [PATCH 2/6] init_decrementer_clockevent can be static __init Milton Miller
2007-12-14 4:52 ` [PATCH 4/6] timer interrupt: use a struct for two per_cpu varables Milton Miller
2007-12-14 4:52 ` [PATCH 5/6] depend on ->initialized in calc_steal_time Milton Miller
2007-12-14 4:52 ` [PATCH 6/6] optimize account_system_vtime Milton Miller
2007-12-15 2:10 ` Michael Neuling
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=mm-cpu-3@bga.com \
--to=miltonm@bga.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).