Details
-
Task
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Incomplete
-
None
Description
The InnoDB engine locks have low contention during OLTP_PS/RO sysbench tests. Assuming this we used compiler specific attributes to annotate code near mutexes making code path acquiring lock easier. Specifically, branches which lead to ut_delay() function were marked `unlikely` and functions which call ut_delay() were marked `cold`. We got persistent +2% improvement in sysbench OLTP_PS 128 thread, meanwhile sysbench OTLP_RO/RW results almost didn't change.
Our environment: Kunpeng 920 (64 cores), Ubuntu 20.04, kernel 5.6.0 with 64K pages, gcc-9.3.0.
Look at the TTASEventMutex implementation, for instance. Here, we can mark while(!try_lock()) as unlikely:
void enter( |
uint32_t max_spins,
|
uint32_t max_delay,
|
const char* filename, |
uint32_t line)
|
UNIV_NOTHROW
|
{
|
uint32_t n_spins = 0;
|
uint32_t n_waits = 0;
|
const uint32_t step = max_spins; |
|
while (UNIV_UNLIKELY(!try_lock())) { |
...
|
Attachments
Issue Links
- is blocked by
-
MDEV-21452 Use condition variables and normal mutexes instead of InnoDB os_event and mutex
- Closed