Bug #44375 | Falcon CycleManager has a hot SyncObject | ||
---|---|---|---|
Submitted: | 21 Apr 2009 6:06 | Modified: | 26 May 2010 17:46 |
Reporter: | Kevin Lewis | Email Updates: | |
Status: | Unsupported | Impact on me: | |
Category: | MySQL Server: Falcon storage engine | Severity: | S3 (Non-critical) |
Version: | 6.0.10 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[21 Apr 2009 6:06]
Kevin Lewis
[21 Apr 2009 6:10]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/72542 3131 Kevin Lewis 2009-04-20 Bug#44375 - Adding an array of SyncObjects to each cycle instead of only one so that the cache line collisions at high concurrency are reduced. Create these SyncObjects as needed using CAS in case multiple threads make them at the same time.
[23 Apr 2009 7:22]
Bugs System
Pushed into 6.0.11-alpha (revid:alik@sun.com-20090423071213-afmyrzvolemph7mz) (version source revid:hky@sun.com-20090421195958-j33v1cuo3yer9niu) (merge vers: 6.0.11-alpha) (pib:6)
[30 Apr 2009 15:25]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/73198 2701 Kevin Lewis 2009-04-30 Bug#44375 copntinued; This is the second part of the optimization of the CycleManager for high concurrency on multiple CPUs. This patch spreads out the purgatory lists into arrays or list heads and makes sure that each list head is on a separate cache line. In addition, it hashes the thread ID to find a consistent slot to use instead of calling rand() to distribute access to the arrays evenly. Since the threadID is not as evenly distributed as rand(), the array is made larger, at 256 elements instead of 64. But this allows the same thread to enter Falcon many times and keep using the same purgatories lists and Cycle syncObject. Also, in order to make the CycleManager more responsive to the need to free memory, itwill now skip the mandatory 1 second sleep between cycles if there is work to be done after the previous cycle. Then after a no-sleep cycle, if there is no work to be done the next time, it will sleep less time than a full second. Probably too much algorithm, but it is adaptive. Also, the destructor now clears any uncleared purgatories, in case that were possible. second