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.
This commit is contained in:
parent
637c17588a
commit
3c57693ff1
@ -76,7 +76,7 @@ Note that if write operation is very fast, a) or b) can be fine as alternative.
|
|||||||
|
|
||||||
#include <log0types.h>
|
#include <log0types.h>
|
||||||
#include "log0sync.h"
|
#include "log0sync.h"
|
||||||
|
#include <mysql/service_thd_wait.h>
|
||||||
/**
|
/**
|
||||||
Helper class , used in group commit lock.
|
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();
|
lk.unlock();
|
||||||
|
|
||||||
/* Sleep until woken in release().*/
|
/* Sleep until woken in release().*/
|
||||||
|
thd_wait_begin(0,THD_WAIT_GROUP_COMMIT);
|
||||||
thread_local_waiter.m_sema.wait();
|
thread_local_waiter.m_sema.wait();
|
||||||
|
thd_wait_end(0);
|
||||||
|
|
||||||
}
|
}
|
||||||
return lock_return_code::EXPIRED;
|
return lock_return_code::EXPIRED;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user