Redundant page state re-checks in buf_LRU_free_from_unzip_LRU_list() and buf_LRU_free_from_common_LRU_list()

Bug #1219833 reported by Laurynas Biveinis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Invalid
Undecided
Unassigned
5.1
Won't Fix
Low
Unassigned
5.5
Fix Released
Medium
Laurynas Biveinis
5.6
Invalid
Undecided
Unassigned

Bug Description

buf_LRU_free_from_unzip_LRU_list() is always called with the LRU list mutex held but contains the following, slightly reduced:

 for (block = UT_LIST_GET_LAST(buf_pool->unzip_LRU);
      UNIV_LIKELY(block != NULL);
      block = UT_LIST_GET_PREV(unzip_LRU, block)) {

  mutex_enter(&block->mutex);
  if (!block->in_unzip_LRU_list || !block->page.in_LRU_list
      || buf_block_get_state(block) != BUF_BLOCK_FILE_PAGE) {
   mutex_exit(&block->mutex);
   goto restart;
  }

The if statement is redundant. Neither one of the three conditions checked there may change while the LRU mutex is held, and it's not being released here.

Related branches

tags: added: bp-split low-hanging-fruit xtradb
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

Likewise in buf_LRU_free_from_common_LRU_list().

summary: - Redundant page state re-check in buf_LRU_free_from_unzip_LRU_list()
+ Redundant page state re-checks in buf_LRU_free_from_unzip_LRU_list() and
+ buf_LRU_free_from_common_LRU_list()
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-3017

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

Bug watches keep track of this bug in other bug trackers.