PS-10595 [9.7]: Lazy initialization for buffer pool block latches#6040
Open
polchawa-percona wants to merge 1 commit into
Open
PS-10595 [9.7]: Lazy initialization for buffer pool block latches#6040polchawa-percona wants to merge 1 commit into
polchawa-percona wants to merge 1 commit into
Conversation
https://perconadev.atlassian.net/browse/PS-10595 Buffer pool initialization speedup. This is a contribution from Alexey Bychko <abychko@gmail.com>, based on: percona@adf7b21 1. Refactor buf_block_init into buf_block_init_light(), performing only lightweight setup without creating latches. 2. Introduce lazy latch initialization for buffer blocks via buf_block_initialize_latches(). 3. Call lazy latch initialization when a block is taken from the free list for the first time. 4. Adjust buf_pool teardown to free mutexes/rwlocks only for blocks that had latches initialized. Modifications on top of the original contribution: - a system variable to enable this optionally; - the lazy initialization is done when a block is taken from the free list; - sharding was removed (it was broken); - replaced the CAS with a regular store to a non-atomic variable: - there are no concurrent accesses to this logic for the same block; - otherwise it would not be thread-safe (a thread could be scheduled out after the CAS succeeded but before creating the mutex); - accesses are protected by free_list_mutex, or happen during startup.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://perconadev.atlassian.net/browse/PS-10595
Buffer pool initialization speedup.
buf_block_initintobuf_block_init_light(), performing only lightweight setup without creating latches.buf_block_initialize_latches().The patch is based on a contribution from Alexey Bychko: adf7b21
Modifications on top of the original contribution: