summaryrefslogtreecommitdiff
path: root/storage/innobase/fil
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-03-05 11:45:28 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2020-03-05 16:21:31 +0200
commita4ab54d70f26f93944e56c8e4e731e1107fdfa6b (patch)
tree5da731b4d210c84a92f0ec62bc95a8870f528de9 /storage/innobase/fil
parent555f955a163040528b24b2a901140e43d7bc580f (diff)
downloadmariadb-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/fil')
-rw-r--r--storage/innobase/fil/fil0fil.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc
index 129f672255b..b946ae3ae91 100644
--- a/storage/innobase/fil/fil0fil.cc
+++ b/storage/innobase/fil/fil0fil.cc
@@ -4462,12 +4462,12 @@ fil_names_dirty(
{
ut_ad(log_mutex_own());
ut_ad(recv_recovery_is_on());
- ut_ad(log_sys.lsn != 0);
+ ut_ad(log_sys.get_lsn() != 0);
ut_ad(space->max_lsn == 0);
ut_d(fil_space_validate_for_mtr_commit(space));
UT_LIST_ADD_LAST(fil_system.named_spaces, space);
- space->max_lsn = log_sys.lsn;
+ space->max_lsn = log_sys.get_lsn();
}
/** Write FILE_MODIFY records when a non-predefined persistent
@@ -4478,7 +4478,7 @@ void fil_names_dirty_and_write(fil_space_t* space)
{
ut_ad(log_mutex_own());
ut_d(fil_space_validate_for_mtr_commit(space));
- ut_ad(space->max_lsn == log_sys.lsn);
+ ut_ad(space->max_lsn == log_sys.get_lsn());
UT_LIST_ADD_LAST(fil_system.named_spaces, space);
mtr_t mtr;