Bug #78894 buf_pool_resize can lock less in checking whether AHI is on or off
Submitted: 21 Oct 2015 7:07 Modified: 21 Oct 2015 9:07
Reporter: Laurynas Biveinis (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S5 (Performance)
Version:5.7.8 OS:Any
Assigned to: CPU Architecture:Any
Tags: ahi, buffer pool resize, innodb

[21 Oct 2015 7:07] Laurynas Biveinis
Description:
void
buf_pool_resize()
{
...
	btr_search_s_lock_all();
	if (btr_search_enabled) {
		btr_search_s_unlock_all();
		btr_search_disabled = true;
	} else {
		btr_search_s_unlock_all();
	}
...

So, it S-latches all the partitions to read btr_search_enabled. But btr_search_enable/disable X-latches all the partitions to change its value. So here it is not required to latch all the partitions, any single one of them is enough.

How to repeat:
Code analysis

Suggested fix:
S-latch only the first or the last or any random partition.
[21 Oct 2015 9:07] MySQL Verification Team
Hello Laurynas,

Thank you for the report.

Thanks,
Umesh