diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2021-02-11 14:52:10 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2021-02-11 14:52:10 +0200 |
commit | b01d8e1a336cd216fd87867cc7f6160c932ae8c0 (patch) | |
tree | 892eec6ff986b4ffd15a862ac731a741771d4f06 /storage/innobase/srv | |
parent | 903464929ca2cd5a3fd994dad90d7bf78d653def (diff) | |
download | mariadb-git-b01d8e1a336cd216fd87867cc7f6160c932ae8c0.tar.gz |
MDEV-20612: Replace lock_sys.mutex with lock_sys.latch
For now, we will acquire the lock_sys.latch only in exclusive mode,
that is, use it as a mutex.
This is preparation for the next commit where we will introduce
a less intrusive alternative, combining a shared lock_sys.latch
with dict_table_t::lock_mutex or a mutex embedded in
lock_sys.rec_hash, lock_sys.prdt_hash, or lock_sys.prdt_page_hash.
Diffstat (limited to 'storage/innobase/srv')
-rw-r--r-- | storage/innobase/srv/srv0srv.cc | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc index 39d358a7165..d75451ce791 100644 --- a/storage/innobase/srv/srv0srv.cc +++ b/storage/innobase/srv/srv0srv.cc @@ -456,19 +456,13 @@ lock -- semaphore; kernel -- kernel; query thread execution: -(a) without lock mutex +(a) without lock_sys.latch reserved -- process executing in user mode; -(b) with lock mutex reserved +(b) with lock_sys.latch reserved -- process executing in kernel mode; -The server has several backgroind threads all running at the same -priority as user threads. It periodically checks if here is anything -happening in the server which requires intervention of the master -thread. Such situations may be, for example, when flushing of dirty -blocks is needed in the buffer pool or old version of database rows -have to be cleaned away (purged). The user can configure a separate -dedicated purge thread(s) too, in which case the master thread does not -do any purging. +The server has several background threads all running at the same +priority as user threads. The threads which we call user threads serve the queries of the MySQL server. They run at normal priority. @@ -800,7 +794,7 @@ srv_printf_innodb_monitor( /* Only if lock_print_info_summary proceeds correctly, before we call the lock_print_info_all_transactions to print all the lock information. IMPORTANT NOTE: This - function acquires the lock mutex on success. */ + function acquires exclusive lock_sys.latch on success. */ ret = lock_print_info_summary(file, nowait); if (ret) { @@ -813,9 +807,8 @@ srv_printf_innodb_monitor( } } - /* NOTE: If we get here then we have the lock mutex. This - function will release the lock mutex that we acquired when - we called the lock_print_info_summary() function earlier. */ + /* NOTE: The following function will release the lock_sys.latch + that lock_print_info_summary() acquired. */ lock_print_info_all_transactions(file); @@ -1235,7 +1228,7 @@ static void srv_monitor() if (srv_print_innodb_monitor) { /* Reset mutex_skipped counter everytime srv_print_innodb_monitor changes. This is to - ensure we will not be blocked by lock_sys.mutex + ensure we will not be blocked by lock_sys.latch for short duration information printing */ if (!monitor_state.last_srv_print_monitor) { monitor_state.mutex_skipped = 0; |