List:Commits« Previous MessageNext Message »
From:Guilhem Bichot Date:July 3 2009 8:22pm
Subject:bzr commit into mysql-5.4 branch (guilhem:2815)
View as plain text  
#At file:///home/mysql_src/bzrrepos/mysql-azalea-guilhem/ based on revid:guilhem@stripped

 2815 Guilhem Bichot	2009-07-03
      Fixes to make summit->azalea merge compile on Linux x86-64
     @ configure.in
        Removed duplicate check for gcc atomic builtins; the first one always disabled them because they broke
        lf* or maria unit tests; but they are needed for Summit's performance, so let's enable them and
        see if unit tests still break. atomic.h does not exist on Linux, removed reference to it.
     @ include/atomic/gcc_builtins.h
        removed one of the two definitions of MY_ATOMIC_MODE in this file (compiler warnings); my_atomic_swap is named my_atomic_fas in azalea/6.0.
     @ include/atomic/solaris.h
        my_atomic_swap is named my_atomic_fas in azalea/6.0.
     @ include/my_atomic.h
        Summit makes use of 8-bit atomic operations; adding implementation for them (though not on Windows
        because Interlocked* supports only "32" and "ptr", but Summit does not use those 8-bit operations
        on Windows anyway).
     @ mysys/Makefile.am
        "libmysys_la_DEPENDENCIES = " overrides automake's default (which is to use what's in _LDADD or _LIBADD),
        so libmysys.la was not considered dependent on libmysyslt.la, so "make -j6" built the first before
        the second, which failed.
     @ storage/innobase/include/sync0sync.ic
        my_atomic_swap is named my_atomic_fas in azalea/6.0.

    modified:
      configure.in
      include/atomic/gcc_builtins.h
      include/atomic/solaris.h
      include/my_atomic.h
      mysys/Makefile.am
      storage/innobase/include/sync0sync.ic
=== modified file 'configure.in'
--- a/configure.in	2009-07-02 14:23:36 +0000
+++ b/configure.in	2009-07-03 20:22:00 +0000
@@ -1788,33 +1788,6 @@ case "$with_atomic_ops" in
                   [Use pthread rwlocks for atomic ops]) ;;
   "smp") ;;
   "")
-    AC_CACHE_CHECK(
-      [whether the compiler provides atomic builtins],
-      [mysql_cv_gcc_atomic_builtins],
-      [AC_RUN_IFELSE(
-         [AC_LANG_PROGRAM([],
-            [[
-	      int foo= -10;
-              int bar=  10;
-        if (!__sync_fetch_and_add(&foo, bar) || foo)
-          return -1;
-        bar= __sync_lock_test_and_set(&foo, bar);
-        if (bar || foo != 10)
-          return -1;
-        bar= __sync_val_compare_and_swap(&bar, foo, 15);
-        if (bar)
-          return -1;
-        return 0;
-            ]]
-         )],
-         [mysql_cv_gcc_atomic_builtins=yes_but_disabled],
-       [mysql_cv_gcc_atomic_builtins=no],
-       [mysql_cv_gcc_atomic_builtins=no])])
-
-    if test "x$mysql_cv_gcc_atomic_builtins" = xyes; then
-      AC_DEFINE(HAVE_GCC_ATOMIC_BUILTINS, 1,
-                [Define to 1 if compiler provides atomic builtins.])
-    fi
    ;;
    *) AC_MSG_ERROR(["$with_atomic_ops" is not a valid value for --with-atomic-ops]) ;;
 esac
@@ -1824,8 +1797,7 @@ AC_CACHE_CHECK([whether the compiler pro
   [AC_RUN_IFELSE(
      [AC_LANG_PROGRAM(
         [
-        #include <atomic.h>
-        ]
+        ],
      [[
         int foo= -10; int bar= 10;
         if (!__sync_fetch_and_add(&foo, bar) || foo)

=== modified file 'include/atomic/gcc_builtins.h'
--- a/include/atomic/gcc_builtins.h	2008-05-29 15:44:11 +0000
+++ b/include/atomic/gcc_builtins.h	2009-07-03 20:22:00 +0000
@@ -13,11 +13,9 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
-#define MY_ATOMIC_MODE "atomic_builtins"
-
 #define make_atomic_add_body(S)                     \
   v= __sync_fetch_and_add(a, v);
-#define make_atomic_swap_body(S)                    \
+#define make_atomic_fas_body(S)                     \
   v= __sync_lock_test_and_set(a, v);
 #define make_atomic_cas_body(S)                     \
   int ## S sav;                                     \

=== modified file 'include/atomic/solaris.h'
--- a/include/atomic/solaris.h	2008-10-16 19:12:16 +0000
+++ b/include/atomic/solaris.h	2009-07-03 20:22:00 +0000
@@ -186,25 +186,25 @@ my_atomic_storeptr(void * volatile *a, v
 /* ------------------------------------------------------------------------ */
 
 STATIC_INLINE int8
-my_atomic_swap8(int8 volatile *a, int8 v)
+my_atomic_fas8(int8 volatile *a, int8 v)
 {
 	return ((int8) atomic_swap_8((volatile uint8_t *)a, (uint8_t)v));
 }
 
 STATIC_INLINE int16
-my_atomic_swap16(int16 volatile *a, int16 v)
+my_atomic_fas16(int16 volatile *a, int16 v)
 {
 	return ((int16) atomic_swap_16((volatile uint16_t *)a, (uint16_t)v));
 }
 
 STATIC_INLINE int32
-my_atomic_swap32(int32 volatile *a, int32 v)
+my_atomic_fas32(int32 volatile *a, int32 v)
 {
 	return ((int32) atomic_swap_32((volatile uint32_t *)a, (uint32_t)v));
 }
 
 STATIC_INLINE void *
-my_atomic_swapptr(void * volatile *a, void *v)
+my_atomic_fasptr(void * volatile *a, void *v)
 {
 	return (atomic_swap_ptr(a, v));
 }

=== modified file 'include/my_atomic.h'
--- a/include/my_atomic.h	2009-07-02 14:23:36 +0000
+++ b/include/my_atomic.h	2009-07-03 20:22:00 +0000
@@ -128,8 +128,12 @@ make_transparent_unions(ptr)
 #define v       U_v.i
 #define set     U_set.i
 #else
+#define U_8    int8
+#define U_16   int16
 #define U_32   int32
 #define U_ptr  intptr
+#define Uv_8   int8
+#define Uv_16  int16
 #define Uv_32  int32
 #define Uv_ptr intptr
 #define U_a    volatile *a
@@ -199,17 +203,27 @@ extern void my_atomic_store ## S(Uv_ ## 
 
 #endif /* HAVE_INLINE */
 
+make_atomic_cas(8)
+make_atomic_cas(16)
 make_atomic_cas(32)
 make_atomic_cas(ptr)
 
+make_atomic_add(8)
+make_atomic_add(16)
 make_atomic_add(32)
 
+make_atomic_load(8)
+make_atomic_load(16)
 make_atomic_load(32)
 make_atomic_load(ptr)
 
+make_atomic_fas(8)
+make_atomic_fas(16)
 make_atomic_fas(32)
 make_atomic_fas(ptr)
 
+make_atomic_store(8)
+make_atomic_store(16)
 make_atomic_store(32)
 make_atomic_store(ptr)
 
@@ -218,8 +232,14 @@ make_atomic_store(ptr)
 #undef _atomic_h_cleanup_
 #endif
 
+#undef U_8
+#undef U_16
 #undef U_32
 #undef U_ptr
+#undef Uv_8
+#undef Uv_16
+#undef Uv_32
+#undef Uv_ptr
 #undef a
 #undef cmp
 #undef v

=== modified file 'mysys/Makefile.am'
--- a/mysys/Makefile.am	2009-07-02 14:23:36 +0000
+++ b/mysys/Makefile.am	2009-07-03 20:22:00 +0000
@@ -25,10 +25,10 @@ LDADD =			$(top_builddir)/strings/libmys
 pkglib_LTLIBRARIES =	libmysys.la
 libmysys_la_LDFLAGS = 	-static
 libmysys_la_SOURCES =   
-libmysys_la_DEPENDENCIES =   
 # This can't be listed here as $(top_builddir)/mysys/libmysyslt.la
 # or it breaks make's dependency track for -j builds
 libmysys_la_LIBADD =	libmysyslt.la libmysyswrap.la
+libmysys_la_DEPENDENCIES = $(libmysys_la_LIBADD)
 # Force C++ linking - dummy.cxx doesn't have to exist with EXTRA in the name
 nodist_EXTRA_libmysys_la_SOURCES = dummy.cxx
 

=== modified file 'storage/innobase/include/sync0sync.ic'
--- a/storage/innobase/include/sync0sync.ic	2009-07-02 14:23:36 +0000
+++ b/storage/innobase/include/sync0sync.ic	2009-07-03 20:22:00 +0000
@@ -89,8 +89,8 @@ mutex_test_and_set(
 
 		return(res);
 #elif defined(MY_ATOMIC_NOLOCK)
-	return ((byte)my_atomic_swap8(
-		(int8 volatile *)&(mutex->lock_word), 1));
+	return ((byte)my_atomic_fas8(
+		(int8 volatile *)&(mutex->lock_word), (int8)1));
 #else
 	ibool	ret;
 
@@ -131,7 +131,7 @@ mutex_reset_lock_word(
 	/* In theory __sync_lock_release should be used to release the lock.
 	Unfortunately, it does not work properly alone. The workaround is
 	that more conservative __sync_lock_test_and_set is used instead. */
-	(void)my_atomic_swap8((int8 volatile *)&(mutex->lock_word), 0);
+	(void)my_atomic_fas8((int8 volatile *)&(mutex->lock_word), (int8)0);
 #else
 	mutex->lock_word = 0;
 


Attachment: [text/bzr-bundle] bzr/guilhem@mysql.com-20090703202200-gin3vg1ofefovd91.bundle
Thread
bzr commit into mysql-5.4 branch (guilhem:2815) Guilhem Bichot3 Jul