Bug #79354 Incomplete NUMA support on buffer pool resizing
Submitted: 20 Nov 2015 10:12 Modified: 7 Dec 2015 18:13
Reporter: Alexey Kopytov Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S4 (Feature request)
Version:5.7.9 OS:Any
Assigned to: CPU Architecture:Any

[20 Nov 2015 10:12] Alexey Kopytov
Description:
Some basic NUMA support has been added to the InnoDB buffer pool as a
part of bug #72811. However, it looks like it's interaction with online
buffer pool resizing was not thought through.

Here's what we do when allocating the buffer pool on startup with
innodb_numa_interleave enabled:

- call set_mempolicy(MPOL_INTERLEAVE, ...) in buf_pool_init() before
  allocating control structures for buffer pool instances, the chunk
  map, chunk control blocks, page and zip hashes and the adaptive hash
  index partitions, so all of those are interleaved;

- call mbind(..., MPOL_INTERLEAVE, ...) in buf_chunk_init() on memory
  allocated for pages (aka block frames) and block descriptors so those
  are interleaved;

Here's what we do when resizing the buffer pool dynamically:

- call buf_chunk_init() for new chunks when the buffer pool is being
  extended. Which calls mbind() and thus guarantees those will be
  interleaved

- if the new buffer pool size differs from the old one by two times,
  recreates the page and zip hashes and adaptive hash index
  partitions. Those, however, are created with the default memory
  policy, which means no interleaving unless overridden with numactl.
  

How to repeat:
Inspect code in buf_pool_init() and buf_pool_resize().

Suggested fix:
Call set_mempolicy(MPOL_INTERLEAVE, ...) in buf_pool_resize().
[1 Dec 2015 15:09] Sinisa Milivojevic
Although, there is no any proof submitted, this seems to be a valid feature request.

Verified.
[7 Dec 2015 18:13] Daniel Price
Posted by developer:
 
Fixed as of the upcoming 5.7.11, 5.8.0 release, and here's the changelog entry:

Numa support was incomplete for online buffer pool resizing operations.

Thank you for the bug report.