summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorShesha Sreenivasamurthy <Shesha.Sreenivasamurthy@Sun.COM>2009-06-03 10:15:31 -0700
committerShesha Sreenivasamurthy <Shesha.Sreenivasamurthy@Sun.COM>2009-06-03 10:15:31 -0700
commit050fa54035f294ec6c58427086e7635a70d94e07 (patch)
tree772a8e4e54d478151e6ce4ed1a16e7e65fbd4218 /usr/src
parent8afffe5e8965958d2c3dc203d9821fb08c33ffb6 (diff)
downloadillumos-joyent-050fa54035f294ec6c58427086e7635a70d94e07.tar.gz
6833717 cpu_smt_pause needs tuning for Rock
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/uts/sun4v/cpu/rock_asm.s51
1 files changed, 24 insertions, 27 deletions
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 <sys/fsr.h> /* FPRS_FEF, FPRS_DU */
#include <vm/hat_sfmmu.h> /* 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 <sys/mutex.h>
+#include <sys/types.h>
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
*/