rw_lock_x_lock_func_nowait() calls os_thread_get_curr_id() mostly needlessly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MySQL Server |
Unknown
|
Unknown
|
|||
Percona Server moved to https://jira.percona.com/projects/PS |
Fix Released
|
Wishlist
|
Laurynas Biveinis | ||
5.1 |
Won't Fix
|
Undecided
|
Unassigned | ||
5.5 |
Won't Fix
|
Undecided
|
Unassigned | ||
5.6 |
Fix Released
|
Wishlist
|
Laurynas Biveinis |
Bug Description
[25 Sep 11:04] Laurynas Biveinis
Description:
ibool
rw_lock_
{
os_thread_id_t curr_thread = os_thread_
...attempt to acquire lock by CAS...
if (success) {
rw_lock_
} else if (lock->recursive
&& os_thread_
...
} else {
...
}
...
}
Thus, curr_thread is only needed if we failed to acquire the lock and it's a recursive lock. os_thread_
How to repeat:
Code analysis, or when you run enough PMP you will see
1 os_thread_
Suggested fix:
After inlining curr_thread variable so that os_thread_
Related branches
- Alexey Kopytov (community): Approve
-
Diff: 4053 lines (+2141/-303)48 files modifiedPercona-Server/mysql-test/suite/sys_vars/r/innodb_priority_cleaner_basic.result (+31/-0)
Percona-Server/mysql-test/suite/sys_vars/r/innodb_priority_io_basic.result (+31/-0)
Percona-Server/mysql-test/suite/sys_vars/r/innodb_priority_master_basic.result (+31/-0)
Percona-Server/mysql-test/suite/sys_vars/r/innodb_priority_purge_basic.result (+31/-0)
Percona-Server/mysql-test/suite/sys_vars/t/innodb_priority_cleaner_basic.test (+40/-0)
Percona-Server/mysql-test/suite/sys_vars/t/innodb_priority_io_basic.test (+40/-0)
Percona-Server/mysql-test/suite/sys_vars/t/innodb_priority_master_basic.test (+40/-0)
Percona-Server/mysql-test/suite/sys_vars/t/innodb_priority_purge_basic.test (+40/-0)
Percona-Server/storage/innobase/btr/btr0sea.cc (+3/-3)
Percona-Server/storage/innobase/buf/buf0buddy.cc (+1/-1)
Percona-Server/storage/innobase/buf/buf0buf.cc (+12/-12)
Percona-Server/storage/innobase/buf/buf0flu.cc (+4/-2)
Percona-Server/storage/innobase/buf/buf0lru.cc (+6/-6)
Percona-Server/storage/innobase/buf/buf0rea.cc (+3/-3)
Percona-Server/storage/innobase/fil/fil0fil.cc (+2/-2)
Percona-Server/storage/innobase/fsp/fsp0fsp.cc (+11/-11)
Percona-Server/storage/innobase/ha/hash0hash.cc (+15/-15)
Percona-Server/storage/innobase/handler/ha_innodb.cc (+31/-0)
Percona-Server/storage/innobase/include/btr0sea.h (+1/-1)
Percona-Server/storage/innobase/include/btr0sea.ic (+1/-1)
Percona-Server/storage/innobase/include/btr0types.h (+1/-1)
Percona-Server/storage/innobase/include/buf0buf.h (+4/-4)
Percona-Server/storage/innobase/include/buf0buf.ic (+4/-4)
Percona-Server/storage/innobase/include/dict0dict.h (+2/-2)
Percona-Server/storage/innobase/include/dict0dict.ic (+1/-1)
Percona-Server/storage/innobase/include/dict0mem.h (+2/-2)
Percona-Server/storage/innobase/include/fil0fil.h (+1/-1)
Percona-Server/storage/innobase/include/ha0ha.ic (+2/-2)
Percona-Server/storage/innobase/include/hash0hash.h (+10/-9)
Percona-Server/storage/innobase/include/hash0hash.ic (+4/-4)
Percona-Server/storage/innobase/include/log0log.h (+1/-1)
Percona-Server/storage/innobase/include/mtr0mtr.h (+3/-3)
Percona-Server/storage/innobase/include/mtr0mtr.ic (+3/-3)
Percona-Server/storage/innobase/include/srv0srv.h (+12/-0)
Percona-Server/storage/innobase/include/sync0rw.h (+350/-70)
Percona-Server/storage/innobase/include/sync0rw.ic (+527/-61)
Percona-Server/storage/innobase/include/sync0sync.h (+187/-0)
Percona-Server/storage/innobase/include/sync0sync.ic (+235/-6)
Percona-Server/storage/innobase/include/sync0types.h (+13/-0)
Percona-Server/storage/innobase/include/trx0purge.h (+1/-1)
Percona-Server/storage/innobase/include/trx0trx.h (+1/-1)
Percona-Server/storage/innobase/include/univ.i (+7/-0)
Percona-Server/storage/innobase/mtr/mtr0mtr.cc (+2/-2)
Percona-Server/storage/innobase/srv/srv0srv.cc (+22/-0)
Percona-Server/storage/innobase/srv/srv0start.cc (+1/-0)
Percona-Server/storage/innobase/sync/sync0arr.cc (+92/-21)
Percona-Server/storage/innobase/sync/sync0rw.cc (+197/-41)
Percona-Server/storage/innobase/sync/sync0sync.cc (+82/-6)
Upstream fix in 5.6.16 / 5.7.4.