[MDEV-12534] Use atomic operations whenever available Created: 2017-04-20  Updated: 2017-05-17  Resolved: 2017-04-21

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB, Storage Engine - XtraDB
Affects Version/s: 10.0, 10.1
Fix Version/s: 10.1.23, 10.0.31, 10.2.6

Type: Bug Priority: Major
Reporter: Marko Mäkelä Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: performance, windows

Issue Links:
Relates
relates to MDEV-12488 Remove type mismatch in InnoDB printf... Closed
Sprint: 10.1.23

 Description   

InnoDB up to MariaDB 10.1 defines the compile-time constant UNIV_WORD_SIZE incorrectly on 64-bit Windows systems as 4:

#ifdef _WIN32
#define UNIV_WORD_SIZE          4
#elif defined(_WIN64)
#define UNIV_WORD_SIZE          8
#else
/** MySQL config.h generated by GNU autoconf will define SIZEOF_LONG in Posix */
#define UNIV_WORD_SIZE          SIZEOF_LONG
#endif

This error has been corrected in MariaDB Server 10.2. The problem is that _WIN32 is defined also on 64-bit Windows, causing UNIV_WORD_SIZE to be defined as the incorrect value 4 instead of 8.

Furthermore, the logic around updating some file counters is refusing to use atomic operations on 32-bit systems, and the variables os_n_pending_reads, os_n_pending_writes are redundant.



 Comments   
Comment by Marko Mäkelä [ 2017-04-20 ]

bb-10.0-marko, merged to bb-10.1-marko together with an experimental MDEV-12488 fix

Comment by Marko Mäkelä [ 2017-04-20 ]

Also merged to bb-10.2-marko along with MDEV-12488.
The 10.2 patch is a bit different, because some of the code has already been simplified, and os0file.cc was completely rewritten.

Comment by Marko Mäkelä [ 2017-04-21 ]

I rebased the merge from bb-10.0-marko to bb-10.1-marko and made this a separate commit to bb-10.2-marko.
All were tested with a revised MDEV-12488 fix.

Generated at Thu Feb 08 07:58:27 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.