Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Sep 2002 16:12:53 -0400 (EDT)
From:      Andrew Gallatin <gallatin@cs.duke.edu>
To:        John Baldwin <jhb@FreeBSD.org>
Cc:        freebsd-alpha@FreeBSD.org, ticso@cicely.de
Subject:   Re: alpha performance on -current
Message-ID:  <15735.47813.266130.216534@grasshopper.cs.duke.edu>
In-Reply-To: <XFMail.20020905122734.jhb@FreeBSD.org>
References:  <15735.31557.85006.684144@grasshopper.cs.duke.edu> <XFMail.20020905122734.jhb@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

OK, if the appended is what you had in mind, then I'm a much happier
camper. 

This patch:

     8314.06 real      7025.32 user       956.14 sys

Stock kernel:

     8699.25 real      6985.64 user      1379.72 sys


A 30% reduction in system time is pretty good.


Cheers,

Drew

Index: include/atomic.h
===================================================================
RCS file: /home/ncvs/src/sys/alpha/include/atomic.h,v
retrieving revision 1.14
diff -u -r1.14 atomic.h
--- include/atomic.h	17 May 2002 05:45:39 -0000	1.14
+++ include/atomic.h	5 Sep 2002 17:03:21 -0000
@@ -55,7 +55,6 @@
 		"bis %0, %3, %0\n\t"		/* calculate new value */
 		"stl_c %0, %1\n\t"		/* attempt to store */
 		"beq %0, 2f\n\t"		/* spin if failed */
-		"mb\n\t"			/* drain to memory */
 		".section .text3,\"ax\"\n"	/* improve branch prediction */
 		"2:\tbr 1b\n"			/* try again */
 		".previous\n"
@@ -73,7 +72,6 @@
 		"bic %0, %3, %0\n\t"		/* calculate new value */
 		"stl_c %0, %1\n\t"		/* attempt to store */
 		"beq %0, 2f\n\t"		/* spin if failed */
-		"mb\n\t"			/* drain to memory */
 		".section .text3,\"ax\"\n"	/* improve branch prediction */
 		"2:\tbr 1b\n"			/* try again */
 		".previous\n"
@@ -91,7 +89,6 @@
 		"addl %0, %3, %0\n\t"		/* calculate new value */
 		"stl_c %0, %1\n\t"		/* attempt to store */
 		"beq %0, 2f\n\t"		/* spin if failed */
-		"mb\n\t"			/* drain to memory */
 		".section .text3,\"ax\"\n"	/* improve branch prediction */
 		"2:\tbr 1b\n"			/* try again */
 		".previous\n"
@@ -109,7 +106,6 @@
 		"subl %0, %3, %0\n\t"		/* calculate new value */
 		"stl_c %0, %1\n\t"		/* attempt to store */
 		"beq %0, 2f\n\t"		/* spin if failed */
-		"mb\n\t"			/* drain to memory */
 		".section .text3,\"ax\"\n"	/* improve branch prediction */
 		"2:\tbr 1b\n"			/* try again */
 		".previous\n"
@@ -130,7 +126,7 @@
 		"beq %1,2f\n\t"		/* if the store failed, spin */
 		"br 3f\n"		/* it worked, exit */
 		"2:\tbr 1b\n"		/* *addr not updated, loop */
-		"3:\tmb\n"		/* it worked */
+		"3:\n"			/* it worked */
 		: "=&r"(result), "=&r"(temp), "=m" (*addr)
 		: "m"(*addr)
 		: "memory");
@@ -147,7 +143,6 @@
 		"bis %0, %3, %0\n\t"		/* calculate new value */
 		"stq_c %0, %1\n\t"		/* attempt to store */
 		"beq %0, 2f\n\t"		/* spin if failed */
-		"mb\n\t"			/* drain to memory */
 		".section .text3,\"ax\"\n"	/* improve branch prediction */
 		"2:\tbr 1b\n"			/* try again */
 		".previous\n"
@@ -165,7 +160,6 @@
 		"bic %0, %3, %0\n\t"		/* calculate new value */
 		"stq_c %0, %1\n\t"		/* attempt to store */
 		"beq %0, 2f\n\t"		/* spin if failed */
-		"mb\n\t"			/* drain to memory */
 		".section .text3,\"ax\"\n"	/* improve branch prediction */
 		"2:\tbr 1b\n"			/* try again */
 		".previous\n"
@@ -183,7 +177,6 @@
 		"addq %0, %3, %0\n\t"		/* calculate new value */
 		"stq_c %0, %1\n\t"		/* attempt to store */
 		"beq %0, 2f\n\t"		/* spin if failed */
-		"mb\n\t"			/* drain to memory */
 		".section .text3,\"ax\"\n"	/* improve branch prediction */
 		"2:\tbr 1b\n"			/* try again */
 		".previous\n"
@@ -201,7 +194,6 @@
 		"subq %0, %3, %0\n\t"		/* calculate new value */
 		"stq_c %0, %1\n\t"		/* attempt to store */
 		"beq %0, 2f\n\t"		/* spin if failed */
-		"mb\n\t"			/* drain to memory */
 		".section .text3,\"ax\"\n"	/* improve branch prediction */
 		"2:\tbr 1b\n"			/* try again */
 		".previous\n"
@@ -222,7 +214,7 @@
 		"beq %1,2f\n\t"		/* if the store failed, spin */
 		"br 3f\n"		/* it worked, exit */
 		"2:\tbr 1b\n"		/* *addr not updated, loop */
-		"3:\tmb\n"		/* it worked */
+		"3:\n"			/* it worked */
 		: "=&r"(result), "=&r"(temp), "=m" (*addr)
 		: "m"(*addr)
 		: "memory");
@@ -257,7 +249,7 @@
 atomic_##NAME##_acq_##WIDTH(volatile u_int##WIDTH##_t *p, u_int##WIDTH##_t v)\
 {									\
 	atomic_##NAME##_##WIDTH(p, v);					\
-	/* alpha_mb(); */						\
+	alpha_mb(); 							\
 }									\
 									\
 static __inline void							\
@@ -271,7 +263,7 @@
 atomic_##NAME##_acq_##TYPE(volatile u_int##WIDTH##_t *p, u_int##WIDTH##_t v)\
 {									\
 	atomic_##NAME##_##WIDTH(p, v);					\
-	/* alpha_mb(); */						\
+	alpha_mb();							\
 }									\
 									\
 static __inline void							\
@@ -361,7 +353,6 @@
 		"mov %3, %0\n\t"		/* value to store */
 		"stl_c %0, %1\n\t"		/* attempt to store */
 		"beq %0, 3f\n\t"		/* if it failed, spin */
-		"mb\n\t"			/* drain to memory */
 		"2:\n"				/* done */
 		".section .text3,\"ax\"\n"	/* improve branch prediction */
 		"3:\tbr 1b\n"			/* try again */
@@ -390,7 +381,6 @@
 		"mov %3, %0\n\t"		/* value to store */
 		"stq_c %0, %1\n\t"		/* attempt to store */
 		"beq %0, 3f\n\t"		/* if it failed, spin */
-		"mb\n\t"			/* drain to memory */
 		"2:\n"				/* done */
 		".section .text3,\"ax\"\n"	/* improve branch prediction */
 		"3:\tbr 1b\n"			/* try again */

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-alpha" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15735.47813.266130.216534>