From 050fa54035f294ec6c58427086e7635a70d94e07 Mon Sep 17 00:00:00 2001 From: Shesha Sreenivasamurthy Date: Wed, 3 Jun 2009 10:15:31 -0700 Subject: 6833717 cpu_smt_pause needs tuning for Rock --- usr/src/uts/sun4v/cpu/rock_asm.s | 51 +++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 27 deletions(-) (limited to 'usr/src') diff --git a/usr/src/uts/sun4v/cpu/rock_asm.s b/usr/src/uts/sun4v/cpu/rock_asm.s index b78652b3f3..f9b1c94894 100644 --- a/usr/src/uts/sun4v/cpu/rock_asm.s +++ b/usr/src/uts/sun4v/cpu/rock_asm.s @@ -20,7 +20,7 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -32,23 +32,8 @@ #include /* FPRS_FEF, FPRS_DU */ #include /* TSBTAG_INVALID */ -#define TRANS_RETRY_COUNT 3 - -/* - * XXX Delete this comment and these #undef's when the corresponding - * Makefile.workarounds lines are deleted. - * XXX - * - * Transactional instructions are used here regardless of what's in - * Makefile.workarounds. - */ -#undef chkpt -#undef commit - - #if defined(lint) - -#include +#include void cpu_smt_pause(void) @@ -131,22 +116,34 @@ cpu_inv_tsb(caddr_t tsb_base, uint_t tsb_bytes) #else /* lint */ -/* XXX TODO XXX - * When we get real hardware, we need to do performance tuning on this. - * Does it help? Does it ever hurt? How many membar's should we have here? +/* + * Called from various spin loops to prevent this strand from + * stealing too many cycles from its sibling, who is presumably + * doing useful work. + * + * With a 2.1 GHz clock, 100 membar #Halt instructions plus + * the call/return overhead will take approximately 500 nanoseconds. + * That is a suitable time for a PAUSE, as it is roughly equal to + * two memory accesses. */ - /* - * Called from various spin loops to prevent this strand from - * stealing too many cycles from its sibling, who is presumably - * doing useful work. - */ ENTRY_NP(cpu_smt_pause) + mov 10, %o0 +1: membar #Halt + membar #Halt + membar #Halt + membar #Halt + membar #Halt + membar #Halt + membar #Halt + membar #Halt + membar #Halt + subcc %o0, 1, %o0 + bg,pt %xcc, 1b membar #Halt retl - nop + membar #Halt SET_SIZE(cpu_smt_pause) - /* * fp_zero() - clear all fp data registers and the fsr */ -- cgit v1.2.3