Bug #52806 Make InnoDB mutexes green
Submitted: 14 Apr 2010 6:32 Modified: 17 Oct 2012 18:05
Reporter: Mark Callaghan Email Updates:
Status: Patch pending Impact on me:
None 
Category:MySQL Server: InnoDB Plugin storage engine Severity:S5 (Performance)
Version:5.1 OS:Any
Assigned to: Assigned Account CPU Architecture:Any
Tags: green, innodb, mutex
Triage: Triaged: D5 (Feature request) / R3 (Medium) / E4 (High)

[14 Apr 2010 6:32] Mark Callaghan
Description:
The InnoDB mutex wakes all waiting threads on unlock. This wastes CPU power as only 1 threads can get the lock. NPTL mutex code wakes one thread using futex calls -- read the glibc source. I know InnoDB can do something similar. I even hacked up a change to do this and produced sysbench numbers that match performance without the change while cutting CPU consumption in half.

How to repeat:
Run a test with a lot of mutex contention

Suggested fix:
Wake one thread instead of all threads.
[16 Oct 2012 15:16] Mark Callaghan
More details at https://www.facebook.com/notes/mysql-at-facebook/green-mutexes/10151060544265933
[17 Oct 2012 18:05] Mark Callaghan
More details at https://www.facebook.com/notes/mysql-at-facebook/green-mutexes-part-2/10151061901390933