[MDEV-6936] Buffer pool list scan optimization Created: 2014-10-24  Updated: 2022-11-25  Resolved: 2014-11-06

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Fix Version/s: 10.1.2

Type: Task Priority: Major
Reporter: Jan Lindström (Inactive) Assignee: Jan Lindström (Inactive)
Resolution: Fixed Votes: 0
Labels: innodb, xtradb

Issue Links:
PartOf
is part of MDEV-6039 WebScaleSQL patches Closed
Problem/Incident
causes MDEV-12091 Shutdown fails to wait for rollback o... Closed
causes MDEV-30089 Metrics not incremented for 1st itera... Closed
Relates
relates to MDEV-15384 buf_flush_LRU_list_batch() always rep... Closed

 Description   

https://github.com/facebook/mysql-5.6

commit 617aef9f911d825e9053f3d611d0389e02031225
Author: Inaam Rana <irana@twitter.com>
Date: Thu Mar 6 09:51:27 2014 -0500

Buffer pool list scan optimization

Summary:
Feature: Optimize Buffer Pool List Scans and Fix Reporting

This patch includes:
– backport of upstream work around buffer pool list scan.
revno: 6228
revision-id: sunny.bains@oracle.com-20130808223745-7lzp6h40vx1ndc7k
parent: marc.alff@oracle.com-20130808135008-p5irewph4fm1yu19
committer: Sunny Bains <Sunny.Bains@Oracle.Com>
branch nick: trunk
timestamp: Fri 2013-08-09 08:37:45 +1000
message:
WL#7047 - Optimize buffer pool list scans and related batch processin

Reduce excessive scanning of pages when doing flush list batches. The
fix is to introduce the concept of "Hazard Pointer", this reduces the
time complexity of the scan from O(n*n) to O.

The concept of hazard pointer is reversed in this work. Academically
hazard pointer is a pointer that the thread working on it will declar
such and as long as that thread is not done no other thread is allowe
do anything with it.

In this WL we declare the pointer as a hazard pointer and then if any
thread attempts to work on it, it is allowed to do so but it has to a
the hazard pointer to the next valid value. We use hazard pointer sol
reverse traversal of lists within a buffer pool instance.

Add an event to control the background flush thread. The background f
thread wait has been converted to an os event timed wait so that it c
signalled by threads that want to kick start a background flush when
buffer pool is running low on free/dirty pages.



 Comments   
Comment by Jan Lindström (Inactive) [ 2014-11-06 ]

commit a03dd94be804a4b8b1406696920834bb2c0bedbd
Author: Jan Lindström <jan.lindstrom@skysql.com>
Date: Thu Nov 6 13:17:11 2014 +0200

MDEV-6936: Buffer pool list scan optimization

Merged Facebook commit 617aef9f911d825e9053f3d611d0389e02031225
authored by Inaam Rana to InnoDB storage engine (not XtraDB)
from https://github.com/facebook/mysql-5.6

WL#7047 - Optimize buffer pool list scans and related batch processing

Reduce excessive scanning of pages when doing flush list batches. The
fix is to introduce the concept of "Hazard Pointer", this reduces the
time complexity of the scan from O(n*n) to O.

The concept of hazard pointer is reversed in this work. Academically
hazard pointer is a pointer that the thread working on it will declar
such and as long as that thread is not done no other thread is allowe
do anything with it.

In this WL we declare the pointer as a hazard pointer and then if any
thread attempts to work on it, it is allowed to do so but it has to a
the hazard pointer to the next valid value. We use hazard pointer sol
reverse traversal of lists within a buffer pool instance.

Add an event to control the background flush thread. The background f
thread wait has been converted to an os event timed wait so that it c
signalled by threads that want to kick start a background flush when
buffer pool is running low on free/dirty pages.

Generated at Thu Feb 08 07:15:43 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.