Commit 2645293
[Feature] Issue#19 BUFFER POOL LIST SCAN OPTIMIZATION
Description:
------------
backport from WebScaleSQL
This patch includes:
--- backport of upstream work around buffer pool list scan.
WL#7047 - Optimize buffer pool list scans and related batch processing code
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(n).
The concept of hazard pointer is reversed in this work. Academically a
hazard pointer is a pointer that the thread working on it will declare as
such and as long as that thread is not done no other thread is allowed to
do anything with it.
In this WL we declare the pointer as a hazard pointer and then if any other
thread attempts to work on it, it is allowed to do so but it has to adjust
the hazard pointer to the next valid value. We use hazard pointer solely for
reverse traversal of lists within a buffer pool instance.
Add an event to control the background flush thread. The background flush
thread wait has been converted to an os event timed wait so that it can be
signalled by threads that want to kick start a background flush when the
buffer pool is running low on free/dirty pages.
--- fix for mysql bug#71411
buf_flush_LRU() returns the number of pages processed. There are
two types of processing that can happen. A page can get evicted or
a page can get flushed. These two numbers are quite distinct and
should not be mixed.1 parent 0a4817f commit 2645293
12 files changed
Lines changed: 565 additions & 406 deletions
File tree
- mysql-test/suite/sys_vars/r
- storage/innobase
- buf
- include
- srv
Lines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | 46 | | |
48 | 47 | | |
49 | 48 | | |
| |||
68 | 67 | | |
69 | 68 | | |
70 | 69 | | |
71 | | - | |
72 | | - | |
73 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
74 | 76 | | |
75 | 77 | | |
76 | 78 | | |
| |||
Lines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | 46 | | |
48 | 47 | | |
49 | 48 | | |
| |||
68 | 67 | | |
69 | 68 | | |
70 | 69 | | |
71 | | - | |
72 | | - | |
73 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
74 | 76 | | |
75 | 77 | | |
76 | 78 | | |
| |||
Lines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | 46 | | |
48 | 47 | | |
49 | 48 | | |
| |||
68 | 67 | | |
69 | 68 | | |
70 | 69 | | |
71 | | - | |
72 | | - | |
73 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
74 | 76 | | |
75 | 77 | | |
76 | 78 | | |
| |||
Lines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | 46 | | |
48 | 47 | | |
49 | 48 | | |
| |||
68 | 67 | | |
69 | 68 | | |
70 | 69 | | |
71 | | - | |
72 | | - | |
73 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
74 | 76 | | |
75 | 77 | | |
76 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1392 | 1392 | | |
1393 | 1393 | | |
1394 | 1394 | | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
1395 | 1408 | | |
1396 | 1409 | | |
1397 | 1410 | | |
| |||
1625 | 1638 | | |
1626 | 1639 | | |
1627 | 1640 | | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
1628 | 1645 | | |
1629 | 1646 | | |
1630 | 1647 | | |
| |||
1663 | 1680 | | |
1664 | 1681 | | |
1665 | 1682 | | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
| 1688 | + | |
| 1689 | + | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
| 1696 | + | |
| 1697 | + | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
| 1711 | + | |
| 1712 | + | |
| 1713 | + | |
| 1714 | + | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
| 1718 | + | |
| 1719 | + | |
| 1720 | + | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
1666 | 1761 | | |
1667 | 1762 | | |
1668 | 1763 | | |
| |||
4149 | 4244 | | |
4150 | 4245 | | |
4151 | 4246 | | |
4152 | | - | |
| 4247 | + | |
| 4248 | + | |
| 4249 | + | |
| 4250 | + | |
4153 | 4251 | | |
4154 | 4252 | | |
4155 | 4253 | | |
| |||
4331 | 4429 | | |
4332 | 4430 | | |
4333 | 4431 | | |
| 4432 | + | |
4334 | 4433 | | |
4335 | 4434 | | |
4336 | 4435 | | |
| |||
4347 | 4446 | | |
4348 | 4447 | | |
4349 | 4448 | | |
| 4449 | + | |
| 4450 | + | |
4350 | 4451 | | |
4351 | 4452 | | |
4352 | 4453 | | |
| |||
4362 | 4463 | | |
4363 | 4464 | | |
4364 | 4465 | | |
| 4466 | + | |
| 4467 | + | |
| 4468 | + | |
| 4469 | + | |
| 4470 | + | |
| 4471 | + | |
| 4472 | + | |
| 4473 | + | |
| 4474 | + | |
| 4475 | + | |
| 4476 | + | |
| 4477 | + | |
| 4478 | + | |
| 4479 | + | |
| 4480 | + | |
| 4481 | + | |
| 4482 | + | |
| 4483 | + | |
4365 | 4484 | | |
4366 | 4485 | | |
4367 | 4486 | | |
4368 | 4487 | | |
4369 | 4488 | | |
4370 | 4489 | | |
4371 | | - | |
4372 | | - | |
4373 | 4490 | | |
4374 | 4491 | | |
4375 | 4492 | | |
| |||
4379 | 4496 | | |
4380 | 4497 | | |
4381 | 4498 | | |
4382 | | - | |
4383 | 4499 | | |
4384 | 4500 | | |
4385 | 4501 | | |
| |||
0 commit comments