Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Aug 2015 20:42:09 +0000 (UTC)
From:      Jason Evans <jasone@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r286907 - in head/contrib/jemalloc: . include/jemalloc
Message-ID:  <201508182042.t7IKg9AZ024144@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jasone
Date: Tue Aug 18 20:42:08 2015
New Revision: 286907
URL: https://svnweb.freebsd.org/changeset/base/286907

Log:
  Define CPU_SPINWAIT as cpu_spinwait().
  
  Submitted by:	cem

Modified:
  head/contrib/jemalloc/FREEBSD-diffs
  head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h

Modified: head/contrib/jemalloc/FREEBSD-diffs
==============================================================================
--- head/contrib/jemalloc/FREEBSD-diffs	Tue Aug 18 20:27:03 2015	(r286906)
+++ head/contrib/jemalloc/FREEBSD-diffs	Tue Aug 18 20:42:08 2015	(r286907)
@@ -117,10 +117,10 @@ index dbf6aa7..f87dba8 100644
  jemalloc_postfork_child
 diff --git a/include/jemalloc/jemalloc_FreeBSD.h b/include/jemalloc/jemalloc_FreeBSD.h
 new file mode 100644
-index 0000000..c5113b9
+index 0000000..737542e
 --- /dev/null
 +++ b/include/jemalloc/jemalloc_FreeBSD.h
-@@ -0,0 +1,144 @@
+@@ -0,0 +1,142 @@
 +/*
 + * Override settings that were generated in jemalloc_defs.h as necessary.
 + */
@@ -135,7 +135,6 @@ index 0000000..c5113b9
 + * The following are architecture-dependent, so conditionally define them for
 + * each supported architecture.
 + */
-+#undef CPU_SPINWAIT
 +#undef JEMALLOC_TLS_MODEL
 +#undef STATIC_PAGE_SHIFT
 +#undef LG_SIZEOF_PTR
@@ -145,7 +144,6 @@ index 0000000..c5113b9
 +
 +#ifdef __i386__
 +#  define LG_SIZEOF_PTR		2
-+#  define CPU_SPINWAIT		__asm__ volatile("pause")
 +#  define JEMALLOC_TLS_MODEL	__attribute__((tls_model("initial-exec")))
 +#endif
 +#ifdef __ia64__
@@ -157,7 +155,6 @@ index 0000000..c5113b9
 +#endif
 +#ifdef __amd64__
 +#  define LG_SIZEOF_PTR		3
-+#  define CPU_SPINWAIT		__asm__ volatile("pause")
 +#  define JEMALLOC_TLS_MODEL	__attribute__((tls_model("initial-exec")))
 +#endif
 +#ifdef __arm__
@@ -183,15 +180,16 @@ index 0000000..c5113b9
 +#  define JEMALLOC_TLS_MODEL	/* Default. */
 +#endif
 +
-+#ifndef CPU_SPINWAIT
-+#  define CPU_SPINWAIT do {} while (0)
-+#endif
-+
 +#define	STATIC_PAGE_SHIFT	PAGE_SHIFT
 +#define	LG_SIZEOF_INT		2
 +#define	LG_SIZEOF_LONG		LG_SIZEOF_PTR
 +#define	LG_SIZEOF_INTMAX_T	3
 +
++#undef CPU_SPINWAIT
++#include <machine/cpu.h>
++#include <machine/cpufunc.h>
++#define	CPU_SPINWAIT		cpu_spinwait()
++
 +/* Disable lazy-lock machinery, mangle isthreaded, and adjust its type. */
 +#undef JEMALLOC_LAZY_LOCK
 +extern int __isthreaded;

Modified: head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h
==============================================================================
--- head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h	Tue Aug 18 20:27:03 2015	(r286906)
+++ head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h	Tue Aug 18 20:42:08 2015	(r286907)
@@ -12,7 +12,6 @@
  * The following are architecture-dependent, so conditionally define them for
  * each supported architecture.
  */
-#undef CPU_SPINWAIT
 #undef JEMALLOC_TLS_MODEL
 #undef STATIC_PAGE_SHIFT
 #undef LG_SIZEOF_PTR
@@ -22,7 +21,6 @@
 
 #ifdef __i386__
 #  define LG_SIZEOF_PTR		2
-#  define CPU_SPINWAIT		__asm__ volatile("pause")
 #  define JEMALLOC_TLS_MODEL	__attribute__((tls_model("initial-exec")))
 #endif
 #ifdef __ia64__
@@ -34,7 +32,6 @@
 #endif
 #ifdef __amd64__
 #  define LG_SIZEOF_PTR		3
-#  define CPU_SPINWAIT		__asm__ volatile("pause")
 #  define JEMALLOC_TLS_MODEL	__attribute__((tls_model("initial-exec")))
 #endif
 #ifdef __arm__
@@ -60,15 +57,16 @@
 #  define JEMALLOC_TLS_MODEL	/* Default. */
 #endif
 
-#ifndef CPU_SPINWAIT
-#  define CPU_SPINWAIT do {} while (0)
-#endif
-
 #define	STATIC_PAGE_SHIFT	PAGE_SHIFT
 #define	LG_SIZEOF_INT		2
 #define	LG_SIZEOF_LONG		LG_SIZEOF_PTR
 #define	LG_SIZEOF_INTMAX_T	3
 
+#undef CPU_SPINWAIT
+#include <machine/cpu.h>
+#include <machine/cpufunc.h>
+#define	CPU_SPINWAIT		cpu_spinwait()
+
 /* Disable lazy-lock machinery, mangle isthreaded, and adjust its type. */
 #undef JEMALLOC_LAZY_LOCK
 extern int __isthreaded;



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