Relative Thread Scheduling Priorities for XtraDB

Registered by Laurynas Biveinis on 2013-09-30

Make priority threads (as defined by [1]) get more CPU time to run. This complements [2] and [3] where priority threads are the first ones to wake up in sync waits.

The implementation is Linux-specific: make use of the fact that setpriority(2) is a per-thread call. A portable alternative would be pthread_setschedparam(), but it's impossible to change the relative thread priority there without changing the thread scheduling policy too, which is a too invasive change.

On Linux, provide an user-exposed tuning option innodb_sched_priority_cleaner=0..39, that corresponds to nice values on Linux 19..-20. If needed, later a mapping from such values to other platform priorities (ie. THREAD_PRIORITY_ABOVE_NORMAL etc. on Windows) might be provided.

Provide similar tuning options for other threads, hidden under UNIV_PERF_DEBUG: innodb_sched_priority_purge, innodb_sched_priority_io, innodb_sched_priority_master.

[1] https://blueprints.launchpad.net/percona-server/+spec/xtradb-thread-priority-flag
[2] https://blueprints.launchpad.net/percona-server/+spec/xtradb-priority-mutex
[3] https://blueprints.launchpad.net/percona-server/+spec/xtradb-priority-rwlock

Blueprint information

Status:
Complete
Approver:
None
Priority:
High
Drafter:
Laurynas Biveinis
Direction:
Approved
Assignee:
Laurynas Biveinis
Definition:
Approved
Series goal:
Accepted for 5.6
Implementation:
Implemented
Milestone target:
milestone icon 5.6.13-61.0
Started by
Laurynas Biveinis on 2013-09-30
Completed by
Laurynas Biveinis on 2013-10-03

Sprints

Whiteboard

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.