Bug #58226 Some InnoDB debug checks consume too much CPU time
Submitted: 16 Nov 2010 11:59 Modified: 10 Jan 2011 22:20
Reporter: Marko Mäkelä Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:all OS:Any
Assigned to: Marko Mäkelä CPU Architecture:Any
Tags: --with-debug, innodb, UNIV_DEBUG

[16 Nov 2010 11:59] Marko Mäkelä
Description:
Some UNIV_DEBUG checks in InnoDB dominate the execution time of the debug server. The fil_io and os_aio operations currently validate the subsystem twice per I/O request, and buf_flush_validate() is being performed every time a block is added to or removed from a flush list.

Also, InnoDB inlining is disabled in the debug server. It may be convenient to disable inlining when debugging a problem, but the inlining makes the code run much faster in tests.

How to repeat:
Run a stress test against a debug server, and collect some CPU_CLK_UNHALTED samples with OProfile. Note some _validate functions on the top of the opreport list.

Suggested fix:
Perform the time-intensive data structure checks every Nth call. Do not disable InnoDB function inlining in the debug server. With these optimizations, we might save enough CPU time to enable UNIV_SYNC_DEBUG in the routine tests of the debug server.
[16 Nov 2010 12:40] 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/124027
[16 Nov 2010 12:40] 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/124028
[16 Nov 2010 13:44] Jimmy Yang
patch approved.
[25 Nov 2010 7:49] Marko Mäkelä
See also Bug #57981.
[1 Dec 2010 8:44] 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/125620
[1 Dec 2010 8:44] 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/125621
[2 Dec 2010 8:16] 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/125758
[2 Dec 2010 8:16] 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/125759
[2 Dec 2010 8:33] 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/125761
[2 Dec 2010 8:33] 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/125762
[22 Dec 2010 21:29] Bugs System
Pushed into mysql-trunk 5.6.1 (revid:alexander.nozdrin@oracle.com-20101222212842-y0t3ibtd32wd9qaw) (version source revid:alexander.nozdrin@oracle.com-20101222212842-y0t3ibtd32wd9qaw) (merge vers: 5.6.1) (pib:24)
[8 Jan 2011 15:10] Bugs System
Pushed into mysql-5.5 5.5.9 (revid:vasil.dimov@oracle.com-20110108150508-gpanhz48z8069qot) (version source revid:vasil.dimov@oracle.com-20110108150048-b1y9m8xe72hay0ch) (merge vers: 5.5.9) (pib:24)