diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-03-05 11:45:28 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-03-05 16:21:31 +0200 |
commit | a4ab54d70f26f93944e56c8e4e731e1107fdfa6b (patch) | |
tree | 5da731b4d210c84a92f0ec62bc95a8870f528de9 /storage/innobase/mtr/mtr0mtr.cc | |
parent | 555f955a163040528b24b2a901140e43d7bc580f (diff) | |
download | mariadb-git-a4ab54d70f26f93944e56c8e4e731e1107fdfa6b.tar.gz |
MDEV-14425 Cleanup: Use std::atomic for some log_sys members
Some fields were protected by log_sys.mutex, which adds quite some
overhead for readers. Some readers were submitting dirty reads.
log_t::lsn: Declare private and atomic. Add wrappers get_lsn()
and set_lsn() that will use relaxed memory access. Many accesses
to log_sys.lsn are still protected by log_sys.mutex; we avoid the
mutex for some readers.
log_t::flushed_to_disk_lsn: Declare private and atomic, and move
to the same cache line with log_t::lsn.
log_t::buf_free: Declare as size_t, and move to the same cache line
with log_t::lsn.
log_t::check_flush_or_checkpoint_: Declare private and atomic,
and move to the same cache line with log_t::lsn.
log_get_lsn(): Define as an alias of log_sys.get_lsn().
log_get_lsn_nowait(), log_peek_lsn(): Remove.
log_get_flush_lsn(): Define as an alias of log_sys.get_flush_lsn().
log_t::initiate_write(): Replaces log_buffer_sync_in_background().
Diffstat (limited to 'storage/innobase/mtr/mtr0mtr.cc')
-rw-r--r-- | storage/innobase/mtr/mtr0mtr.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/storage/innobase/mtr/mtr0mtr.cc b/storage/innobase/mtr/mtr0mtr.cc index 45c2ac68ef1..c058a93265c 100644 --- a/storage/innobase/mtr/mtr0mtr.cc +++ b/storage/innobase/mtr/mtr0mtr.cc @@ -459,7 +459,7 @@ void mtr_t::commit_files(lsn_t checkpoint_lsn) if (checkpoint_lsn) { DBUG_PRINT("ib_log", ("FILE_CHECKPOINT(" LSN_PF ") written at " LSN_PF, - checkpoint_lsn, log_sys.lsn)); + checkpoint_lsn, log_sys.get_lsn())); } } @@ -589,7 +589,7 @@ inline ulint mtr_t::prepare_write() ut_ad(m_log_mode == MTR_LOG_NO_REDO); ut_ad(m_log.size() == 0); log_mutex_enter(); - m_commit_lsn = log_sys.lsn; + m_commit_lsn = log_sys.get_lsn(); return 0; } |