Bug #64116 fil_space_get_size called too frequently
Submitted: 23 Jan 2012 20:05 Modified: 24 Jan 2012 8:47
Reporter: Mark Callaghan Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: InnoDB Plugin storage engine Severity:S5 (Performance)
Version:5.1,5.5,5.6 OS:Any
Assigned to: CPU Architecture:Any
Tags: fil_space_get_size, innodb

[23 Jan 2012 20:05] Mark Callaghan
Description:
buf_flush_try_neighbors has two calls to fil_space_get_size. This can be converted to one call if the result from the first call is saved. As fil_space_get_mutex locks/unlocks a global mutex (fil_system->mutex) I think this is a good change whether or not it produces a benefit on a benchmark.

        if (high > fil_space_get_size(space)) {
                high = fil_space_get_size(space);
        }

buf_read_ahead_linear also does this

How to repeat:
read the source

Suggested fix:
save the result
[24 Jan 2012 8:47] Valeriy Kravchuk
Thank you for the problem report. Verified by code review.