diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2022-11-28 11:34:00 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2022-11-28 11:34:00 +0200 |
commit | e0d672f30b8a7d5486c367b5ed8ec58e41c1b6b1 (patch) | |
tree | fa5916a34181f5a4eec148708589b18a18674efe | |
parent | 183ca823bbddec81bbb2ec64bd314a50851e39c5 (diff) | |
download | mariadb-git-e0d672f30b8a7d5486c367b5ed8ec58e41c1b6b1.tar.gz |
MDEV-30089 Metrics not incremented for 1st iteration in buf_LRU_free_from_common_LRU_list()
In commit a03dd94be804a4b8b1406696920834bb2c0bedbd as well as
mysql/mysql-server@6ef8c343445a26aaf9ebd76d72cf57db44b481f5
the iterations were changed so that the variable "scanned"
would remain 0 when the first list item qualifies for eviction.
buf_LRU_free_from_unzip_LRU_list(), buf_LRU_free_from_common_LRU_list():
Increment "scanned" when a block can be freed.
buf_LRU_free_from_common_LRU_list(): Remove a redundant condition.
Whenever this function is invoked, buf_pool.LRU should be nonempty,
hence something should always be scanned.
Thanks to Jean-François Gagné for reporting this.
-rw-r--r-- | storage/innobase/buf/buf0lru.cc | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/storage/innobase/buf/buf0lru.cc b/storage/innobase/buf/buf0lru.cc index b282eb17dae..b8f3b23a477 100644 --- a/storage/innobase/buf/buf0lru.cc +++ b/storage/innobase/buf/buf0lru.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, 2021, MariaDB Corporation. +Copyright (c) 2017, 2022, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -189,8 +189,6 @@ LRU list. The compressed page is preserved, and it need not be clean. @return true if freed */ static bool buf_LRU_free_from_unzip_LRU_list(ulint limit) { - mysql_mutex_assert_owner(&buf_pool.mutex); - if (!buf_LRU_evict_from_unzip_LRU()) { return(false); } @@ -208,6 +206,7 @@ static bool buf_LRU_free_from_unzip_LRU_list(ulint limit) freed = buf_LRU_free_page(&block->page, false); if (freed) { + scanned++; break; } @@ -252,17 +251,16 @@ static bool buf_LRU_free_from_common_LRU_list(ulint limit) } freed = true; + scanned++; break; } } - if (scanned) { - MONITOR_INC_VALUE_CUMULATIVE( - MONITOR_LRU_SEARCH_SCANNED, - MONITOR_LRU_SEARCH_SCANNED_NUM_CALL, - MONITOR_LRU_SEARCH_SCANNED_PER_CALL, - scanned); - } + MONITOR_INC_VALUE_CUMULATIVE( + MONITOR_LRU_SEARCH_SCANNED, + MONITOR_LRU_SEARCH_SCANNED_NUM_CALL, + MONITOR_LRU_SEARCH_SCANNED_PER_CALL, + scanned); return(freed); } |