Skip to content

Commit 3da13ea

Browse files
committed
Change performance schema alignment to CPU_LEVEL1_DCACHE_LINESIZE
Inspired by Alexey Kopytov's pull request mysql/mysql-server#42 the PFS_ALIGNED is set to CPU_LEVEL1_DCACHE_LINESIZE if defined. A more complete patch in MySQL-5.7: mysql/mysql-server@0d55a07 Inspired by the complete patch the volatile global variables of the performance schema have been quantified by PFS_ALIGNED.
1 parent 4fe1c9f commit 3da13ea

File tree

5 files changed

+6
-5
lines changed

5 files changed

+6
-5
lines changed

storage/perfschema/pfs_digest.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ bool flag_statements_digest= true;
4747
Current index in Stat array where new record is to be inserted.
4848
index 0 is reserved for "all else" case when entire array is full.
4949
*/
50-
volatile uint32 digest_index;
50+
PFS_ALIGNED volatile uint32 digest_index;
5151
bool digest_full= false;
5252

5353
LF_HASH digest_hash;

storage/perfschema/pfs_events_stages.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ bool flag_events_stages_history_long= false;
4141
/** True if EVENTS_STAGES_HISTORY_LONG circular buffer is full. */
4242
bool events_stages_history_long_full= false;
4343
/** Index in EVENTS_STAGES_HISTORY_LONG circular buffer. */
44-
volatile uint32 events_stages_history_long_index= 0;
44+
PFS_ALIGNED volatile uint32 events_stages_history_long_index= 0;
4545
/** EVENTS_STAGES_HISTORY_LONG circular buffer. */
4646
PFS_events_stages *events_stages_history_long_array= NULL;
4747

storage/perfschema/pfs_events_statements.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ bool flag_events_statements_history_long= false;
4141
/** True if EVENTS_STATEMENTS_HISTORY_LONG circular buffer is full. */
4242
bool events_statements_history_long_full= false;
4343
/** Index in EVENTS_STATEMENTS_HISTORY_LONG circular buffer. */
44-
volatile uint32 events_statements_history_long_index= 0;
44+
PFS_ALIGNED volatile uint32 events_statements_history_long_index= 0;
4545
/** EVENTS_STATEMENTS_HISTORY_LONG circular buffer. */
4646
PFS_events_statements *events_statements_history_long_array= NULL;
4747
static unsigned char *h_long_stmts_digest_token_array= NULL;

storage/perfschema/pfs_events_waits.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ bool flag_thread_instrumentation= false;
4545
/** True if EVENTS_WAITS_HISTORY_LONG circular buffer is full. */
4646
bool events_waits_history_long_full= false;
4747
/** Index in EVENTS_WAITS_HISTORY_LONG circular buffer. */
48-
volatile uint32 events_waits_history_long_index= 0;
48+
PFS_ALIGNED volatile uint32 events_waits_history_long_index= 0;
4949
/** EVENTS_WAITS_HISTORY_LONG circular buffer. */
5050
PFS_events_waits *events_waits_history_long_array= NULL;
5151

storage/perfschema/pfs_lock.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
Performance schema internal locks (declarations).
2222
*/
2323

24+
#include "pfs_global.h"
2425
#include "pfs_atomic.h"
2526

2627
/**
@@ -79,7 +80,7 @@ struct pfs_lock
7980
The version number is stored in the high 30 bits.
8081
The state is stored in the low 2 bits.
8182
*/
82-
volatile uint32 m_version_state;
83+
PFS_ALIGNED volatile uint32 m_version_state;
8384

8485
/** Returns true if the record is free. */
8586
bool is_free(void)

0 commit comments

Comments
 (0)