Commit 5da664b
committed
PS-11120: Reduce contention on BUF_BLOCK_MUTEX by reading ahead the access_time
This patch reduces contention inside buf_page_optimistic_get. We acquire there
the BUF_BLOCK_MUTEX twice. But the second time we acquire only to update the
access time. Given that we would update the access time only if it was zero,
we could avoid acquiring the mutex when we knew that the access time was already
non-zero. This we could learn the first time we acquired the mutex by reading
the access time field of the page.
Note: the second time we acquired the mutex, we re-check if it still was zero
anyway, so the patch is safe and allows to save significant number of times
we needed to acquire the mutex.
This is a contribution from: Anna Glasgall (with a minor fix).1 parent 29c0faa commit 5da664b
1 file changed
Lines changed: 31 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4589 | 4589 | | |
4590 | 4590 | | |
4591 | 4591 | | |
| 4592 | + | |
| 4593 | + | |
| 4594 | + | |
| 4595 | + | |
4592 | 4596 | | |
4593 | 4597 | | |
4594 | 4598 | | |
| |||
4635 | 4639 | | |
4636 | 4640 | | |
4637 | 4641 | | |
4638 | | - | |
| 4642 | + | |
| 4643 | + | |
| 4644 | + | |
| 4645 | + | |
| 4646 | + | |
4639 | 4647 | | |
4640 | | - | |
| 4648 | + | |
| 4649 | + | |
4641 | 4650 | | |
4642 | | - | |
| 4651 | + | |
| 4652 | + | |
| 4653 | + | |
| 4654 | + | |
4643 | 4655 | | |
4644 | | - | |
| 4656 | + | |
| 4657 | + | |
| 4658 | + | |
| 4659 | + | |
| 4660 | + | |
| 4661 | + | |
| 4662 | + | |
4645 | 4663 | | |
4646 | | - | |
| 4664 | + | |
| 4665 | + | |
| 4666 | + | |
| 4667 | + | |
| 4668 | + | |
| 4669 | + | |
| 4670 | + | |
4647 | 4671 | | |
4648 | 4672 | | |
4649 | 4673 | | |
| |||
4661 | 4685 | | |
4662 | 4686 | | |
4663 | 4687 | | |
4664 | | - | |
| 4688 | + | |
4665 | 4689 | | |
4666 | 4690 | | |
4667 | 4691 | | |
| 4692 | + | |
4668 | 4693 | | |
4669 | 4694 | | |
4670 | 4695 | | |
| |||
0 commit comments