~laurynas-biveinis/percona-server/xtradb-thread-priority-flag

  • Committer: Laurynas Biveinis
  • Date: 2013-09-26 14:58:37 UTC
  • Revision ID: laurynas.biveinis@percona.com-20130926145837-ykbaju5u4dadmvdr
Implement priority RW lock
(https://blueprints.launchpad.net/percona-server/+spec/xtradb-priority-rwlock).

The priority RW lock is implemented through a new type prio_rw_lock_t
that includes regular rw_lock_t as its first member (code exploits the
regular RW lock being priority RW lock prefix in memory in several
places).  Extend it by adding separate events for high priority
waiters with corresponding waiters flag.  Implement priority RW lock
API as C++ overloads for the existing regular RW lock API in order to
minimize code differences outside sync0rw.*.  In all cases the
acquisition priority is determined by the relative priority of the
current thread.  No new API to override this has been defined.

The priority order for priority RW lock waiters has been implemented
as follows:
1) high priority next-writer waiter; 
2) high priority X waiters; 
3) high priority S waiters; 
4) regular priority next-writer waiter; 
5) regular priority waiters.

Another priority RW lock behavior change from the regular RW lock is
that a regular priority S request always checks for high-priority
waiters presence before attempting to lock and does not attempt to
lock if any found.  This is done even for the cases where such lock
attempt would succeed, in order to prevent a situation where a
sequence of partially overlapping S requests starve a high priority X
waiter indefinitely.  Moreover, this is a performance optimization by
skipping redundant spinning, done for X requests too, where the
correctness issue does not apply.

Adjust rw_lock_x_lock_func() to accept both regular and priority
lock by passing the lock as a generic void * pointer, which is then
casted and processed according to the newly-added priority flags.
Likewise for rw_lock_s_lock_spin().  Refactor out
rw_lock_x_prepare_unlock() from rw_lock_x_unlock_func() to be used
from both its overloads.

Define new wait array object types PRIO_RW_LOCK_SHARED and
PRIO_RW_LOCK_EX.

Convert the following locks to be priority: fsp, page_hash, AHI,
index, purge.

At the same time fix http://bugs.mysql.com/bug.php?id=70417 / bug
1230220 (rw_lock_x_lock_func_nowait() calls os_thread_get_curr_id()
mostly needlessly) by pushing down the os_thread_get_curr_id() call to
its actual use site in rw_lock_x_lock_func_nowait().
Filename Latest Rev Last Changed Committer Comment Size
..
build 341 11 years ago jenkins at percona Merge lp:~abychko/percona-server/bug1050654-5.6 ht Diff
doc 234.57.1 12 years ago Stewart Smith merge theme-makefile-5.1 from 5.1 tree. This basic Diff
Percona-Server 317.3.7 11 years ago Laurynas Biveinis Null-merge lp:percona-server/5.6 revision 318. Diff
policy 234.205.1 11 years ago Raghavendra D Prabhu Bug #1131102: Provide SELinux policy for PXC. Thi Diff
python-for-subunit2junitxml 234.227.2 11 years ago Laurynas Biveinis Merge percona_userstat testcase from 5.1, partiall Diff
UDF 234.227.2 11 years ago Laurynas Biveinis Merge percona_userstat testcase from 5.1, partiall Diff
.bzrignore 404.1.1 11 years ago Hrvoje Matijakovic - created list of system and status variables intr 6 bytes Diff Download File
COPYING.innodb-deadlock-count-patch 10 13 years ago Oleg Tsarev propogate Oleg's patches 1.6 KB Diff Download File
COPYING.show_temp_51 234.227.2 11 years ago Laurynas Biveinis Merge percona_userstat testcase from 5.1, partiall 1.6 KB Diff Download File
Makefile 416.2.1 11 years ago Ignacio Nin Bump versions to 5.5.13-60.5 2.9 KB Diff Download File
File subunit2junitxml 234.227.2 11 years ago Laurynas Biveinis Merge percona_userstat testcase from 5.1, partiall 2.2 KB Diff Download File