From 3c57693ff199b066c9cd5eef4f5a2ec6ca5b7898 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Sun, 15 Mar 2020 21:40:11 +0100 Subject: [PATCH] MDEV-21534 - Improve innodb redo log group commit performance Instrument new synchronization primitive with thd_wait_begin/end to inform threadpool about waits. This considerably improve performance on write benchmarks (e.g sysbench update_index) with generic threadpool, of course the cost is possibility of many newly created threads. --- storage/innobase/log/log0sync.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/storage/innobase/log/log0sync.cc b/storage/innobase/log/log0sync.cc index 563b178e427..67df0a315e9 100644 --- a/storage/innobase/log/log0sync.cc +++ b/storage/innobase/log/log0sync.cc @@ -76,7 +76,7 @@ Note that if write operation is very fast, a) or b) can be fine as alternative. #include #include "log0sync.h" - +#include /** Helper class , used in group commit lock. @@ -239,7 +239,10 @@ group_commit_lock::lock_return_code group_commit_lock::acquire(value_type num) lk.unlock(); /* Sleep until woken in release().*/ + thd_wait_begin(0,THD_WAIT_GROUP_COMMIT); thread_local_waiter.m_sema.wait(); + thd_wait_end(0); + } return lock_return_code::EXPIRED; }