Skip to content

Commit

Permalink
MDEV-10341: InnoDB: Failing assertion: mutex_own(mutex) - mutex_exit_…
Browse files Browse the repository at this point in the history
…func

Followup from 5.5 patch. Removing memory barriers on intel is wrong as
this doesn't prevent the compiler and/or processor from reorganizing reads
before the mutex release. Forcing a memory barrier before reading the waiters will
guarantee that no speculative reading takes place.
  • Loading branch information
cvicentiu committed Aug 23, 2016
1 parent 4eb898b commit ed99e2c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
10 changes: 1 addition & 9 deletions storage/innobase/include/os0sync.h
Original file line number Diff line number Diff line change
Expand Up @@ -849,15 +849,7 @@ for synchronization */
} while (0);

/** barrier definitions for memory ordering */
#ifdef IB_STRONG_MEMORY_MODEL
/* Performance regression was observed at some conditions for Intel
architecture. Disable memory barrier for Intel architecture for now. */
# define os_rmb do { } while(0)
# define os_wmb do { } while(0)
# define os_mb do { } while(0)
# define IB_MEMORY_BARRIER_STARTUP_MSG \
"Memory barrier is not used"
#elif defined(HAVE_IB_GCC_ATOMIC_THREAD_FENCE)
#if defined(HAVE_IB_GCC_ATOMIC_THREAD_FENCE)
# define HAVE_MEMORY_BARRIER
# define os_rmb __atomic_thread_fence(__ATOMIC_ACQUIRE)
# define os_wmb __atomic_thread_fence(__ATOMIC_RELEASE)
Expand Down
10 changes: 1 addition & 9 deletions storage/xtradb/include/os0sync.h
Original file line number Diff line number Diff line change
Expand Up @@ -900,15 +900,7 @@ for synchronization */
} while (0);

/** barrier definitions for memory ordering */
#ifdef IB_STRONG_MEMORY_MODEL
/* Performance regression was observed at some conditions for Intel
architecture. Disable memory barrier for Intel architecture for now. */
# define os_rmb do { } while(0)
# define os_wmb do { } while(0)
# define os_mb do { } while(0)
# define IB_MEMORY_BARRIER_STARTUP_MSG \
"Memory barrier is not used"
#elif defined(HAVE_IB_GCC_ATOMIC_THREAD_FENCE)
#if defined(HAVE_IB_GCC_ATOMIC_THREAD_FENCE)
# define HAVE_MEMORY_BARRIER
# define os_rmb __atomic_thread_fence(__ATOMIC_ACQUIRE)
# define os_wmb __atomic_thread_fence(__ATOMIC_RELEASE)
Expand Down

0 comments on commit ed99e2c

Please sign in to comment.