aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/kernel/uv_time.c
diff options
context:
space:
mode:
authorDimitri Sivanich <sivanich@sgi.com>2010-01-22 09:41:40 -0600
committerIngo Molnar <mingo@elte.hu>2010-01-27 11:33:53 +0100
commitaca3bb5910119d4cf6c28568a642582efb4cc14a (patch)
treea6a14bbb8a9ae4b469b506d1c611c41637e311ce /arch/x86/kernel/uv_time.c
parente0b5f80dd4226a920257c91a3b9070e81149060b (diff)
x86, UV: Fix RTC latency bug by reading replicated cachelines
For SGI UV node controllers (HUB) rev 2.0 or greater, use replicated cachelines to read the RTC timer. This optimization allows faster simulataneous reads from a given socket. Signed-off-by: Dimitri Sivanich <sivanich@sgi.com> Cc: Jack Steiner <steiner@sgi.com> LKML-Reference: <20100122154140.GB4975@sgi.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/uv_time.c')
-rw-r--r--arch/x86/kernel/uv_time.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/arch/x86/kernel/uv_time.c b/arch/x86/kernel/uv_time.c
index 3c84aa001c1..2b75ef638db 100644
--- a/arch/x86/kernel/uv_time.c
+++ b/arch/x86/kernel/uv_time.c
@@ -282,10 +282,21 @@ static int uv_rtc_unset_timer(int cpu, int force)
/*
* Read the RTC.
+ *
+ * Starting with HUB rev 2.0, the UV RTC register is replicated across all
+ * cachelines of it's own page. This allows faster simultaneous reads
+ * from a given socket.
*/
static cycle_t uv_read_rtc(struct clocksource *cs)
{
- return (cycle_t)uv_read_local_mmr(UVH_RTC);
+ unsigned long offset;
+
+ if (uv_get_min_hub_revision_id() == 1)
+ offset = 0;
+ else
+ offset = (uv_blade_processor_id() * L1_CACHE_BYTES) % PAGE_SIZE;
+
+ return (cycle_t)uv_read_local_mmr(UVH_RTC | offset);
}
/*