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

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.039 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.