From 0b5d84dc5d7fb8bf643e85e51f3600b22ec66b30 Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Wed, 30 Dec 2015 23:34:07 +0300 Subject: [PATCH] MySQL bug #79379: Inconsistent innodb_buffer_pool_size handling Remove code reserving extra bytes for the allocated memory block in buf_chunk_init(). Those extra bytes break the alignment even if the originally requested chunk is already properly aligned on all levels. That in turn results in all kinds of inconsistencies with large OS pages in setting innodb_buffer_pool_size both statically and dynamically. --- mysql-test/suite/innodb/t/innodb.test | 2 +- storage/innobase/buf/buf0buf.cc | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/mysql-test/suite/innodb/t/innodb.test b/mysql-test/suite/innodb/t/innodb.test index 135d17242d9..3eff391076a 100644 --- a/mysql-test/suite/innodb/t/innodb.test +++ b/mysql-test/suite/innodb/t/innodb.test @@ -1329,7 +1329,7 @@ drop table t1; # Test for testable InnoDB status variables. This test # uses previous ones(pages_created, rows_deleted, ...). --disable_warnings ---replace_result 1535 {checked_valid} 1536 {checked_valid} 3071 {checked_valid} 3072 {checked_valid} 6144 {checked_valid} +--replace_result 1535 {checked_valid} 1536 {checked_valid} 3071 {checked_valid} 3072 {checked_valid} 6144 {checked_valid} 1463 {checked_valid} SELECT variable_value FROM performance_schema.global_status WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total'; --replace_result 4096 {checked_valid} 8192 {checked_valid} 16384 {checked_valid} SELECT variable_value FROM performance_schema.global_status WHERE LOWER(variable_name) = 'innodb_page_size'; diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc index 0fa01eca2f7..4be634a6481 100644 --- a/storage/innobase/buf/buf0buf.cc +++ b/storage/innobase/buf/buf0buf.cc @@ -807,10 +807,6 @@ static buf_chunk_t *buf_chunk_init( /* Round down to a multiple of page size, although it already should be. */ mem_size = ut_2pow_round(mem_size, UNIV_PAGE_SIZE); - /* Reserve space for the block descriptors. */ - mem_size += ut_2pow_round( - (mem_size / UNIV_PAGE_SIZE) * (sizeof *block) + (UNIV_PAGE_SIZE - 1), - UNIV_PAGE_SIZE); DBUG_EXECUTE_IF("ib_buf_chunk_init_fails", return (NULL););