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 on 2013-09-02
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server
Status tracked in 5.6
5.1
Low
Unassigned
5.5
Medium
Laurynas Biveinis
5.6
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

lp:~laurynas-biveinis/percona-server/bug1305364-5.5
Vlad Lesin: Approve (g2) on 2014-04-28
tags: added: bp-split low-hanging-fruit xtradb

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()
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related blueprints