Skip to content

PS-10595 [9.7]: Combined buffer-pool init speedup: lazy latch init + rwlock bulk register.#6058

Open
polchawa-percona wants to merge 1 commit into
percona:9.7from
polchawa-percona:PS-10595-9.7-combined-lazyinit-rwlatchbulkreg
Open

PS-10595 [9.7]: Combined buffer-pool init speedup: lazy latch init + rwlock bulk register.#6058
polchawa-percona wants to merge 1 commit into
percona:9.7from
polchawa-percona:PS-10595-9.7-combined-lazyinit-rwlatchbulkreg

Conversation

@polchawa-percona

Copy link
Copy Markdown
Contributor

https://perconadev.atlassian.net/browse/PS-10595
https://perconadev.atlassian.net/browse/PS-11120

Combines two buffer-pool initialization speedups:

  1. Reduce rw_lock_list contention during buffer pool initialization by
    registering block rw-locks in bulk via an O(1) list splice under
    rw_lock_list_mutex instead of taking it once per block.

  2. Lazy per-block latch initialization — defer creation of each block's
    mutex and rw-locks until the block is first used, gated by the new
    innodb_buffer_pool_lazy_latch_init sysvar (disabled by default, since
    it defers the cost to runtime). While it is disabled, the first
    optimization still helps a little bit.

Also carries clang-tidy include-cleaner fixes: direct #includes added to
buf0buf.cc and sync0rw.cc so the include-cleaner step passes.

These changes are cherry-picked from a contribution we got from:
Alexey Bychko abychko@gmail.com

@polchawa-percona polchawa-percona requested review from percona-ysorokin and satya-bodapati and removed request for percona-ysorokin July 3, 2026 09:02
@polchawa-percona polchawa-percona force-pushed the PS-10595-9.7-combined-lazyinit-rwlatchbulkreg branch 4 times, most recently from b8a062f to 195bf77 Compare July 9, 2026 11:28
@polchawa-percona polchawa-percona force-pushed the PS-10595-9.7-combined-lazyinit-rwlatchbulkreg branch from 195bf77 to 81dd7cf Compare July 14, 2026 14:52
…tion

https://perconadev.atlassian.net/browse/PS-10595

Combines two buffer-pool initialization speedups:

1. Reduce rw_lock_list contention during buffer pool initialization
   by registering block rw-locks in bulk via an O(1) list splice
   under rw_lock_list_mutex instead of taking it once per block.

2. Lazy per-block latch initialization - defer creation of each
   block's mutex and rw-locks until the block is first used.

The second optimization is deferring the cost (paid later in runtime).
Therefore it is disabled by default and a new sysvar has to be used
to enable it: innodb_buffer_pool_lazy_latch_init.

While it is disabled, the first optimization helps a little bit.

These changes are based on a contribution we got from:
Alexey Bychko <abychko@gmail.com>
@polchawa-percona polchawa-percona force-pushed the PS-10595-9.7-combined-lazyinit-rwlatchbulkreg branch from 81dd7cf to 9b59ed0 Compare July 14, 2026 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant