Uploaded image for project: 'Percona Server for MySQL'
  1. Percona Server for MySQL
  2. PS-5771

Unable to use innodb_buffer_pool_chunk_size > 3934M with large pages

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Medium
    • Resolution: Duplicate
    • Affects Version/s: 5.7.26-29
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Environment:

      Oracle Linux Server release 7.5

      4.14.35-1844.4.5.el7uek.x86_64

      Description

      Unable to set innodb_buffer_pool_chunk_size to more than 3934M

      To reproduce set the following parameters in my.cnf:

       

      innodb_buffer_pool_size = 3936M
      innodb_buffer_pool_instances = 1
      innodb_buffer_pool_chunk_size = 3936M 
      

      Diagnostics:

      In this case we request one buffer pool instance with a single chunk of 3936M. But we see the following:

      mysql> SELECT pool_size                                 as "real pool size (pages)",
          ->        @@innodb_page_size                        as "page size (bytes)",
          ->        @@innodb_buffer_pool_chunk_size/1024/1024 as "innodb_buffer_pool_chunk_size (MB)",
          ->        @@innodb_buffer_pool_size/1024/1024       as "innodb_buffer_pool_size (MB)"
          -> FROM information_schema.INNODB_BUFFER_POOL_STATS\G
      *************************** 1. row ***************************
                  real pool size (pages): 122
                       page size (bytes): 16384
      innodb_buffer_pool_chunk_size (MB): 3936.00000000
            innodb_buffer_pool_size (MB): 3936.00000000
      1 row in set (0.00 sec)
      

      It corresponds with pmap output:

               Address Perm   Offset Device    Inode    Size    Rss    Pss Referenced Anonymous LazyFree ShmemPmdMapped Shared_Hugetlb Private_Hugetlb Swap SwapPss Locked Mapping
              00400000 r-xp 00000000  fc:00   852597   22648  12268  12268      12268         0        0              0              0               0    0       0      0 mysqld
              01c1d000 r--p 0161d000  fc:00   852597     952    816    816        572       436        0              0              0               0    0       0      0 mysqld
              01d0b000 rw-p 0170b000  fc:00   852597     700    500    500        500       200        0              0              0               0    0       0      0 mysqld
      ...
                                                     ======= ====== ====== ========== ========= ======== ============== ============== =============== ==== ======= ====== 
                                                     1434224 219648 214842     219148    199060        0              0              0            4096    0       0      0 KB

      The probable root cause of the behaviour is that function, used for chunk memory allocation in large page pool

      void*
      os_mem_alloc_large(
              ulint*  n,
              bool    populate)
      

      calculates size as follows:

              size = ut_2pow_round(*n + (os_large_page_size - 1),
                                   os_large_page_size);
      

      First argument of ut_2pow_round is of type ulint and the second is uint.
      Result size will be of type uint (upper bits are zeroed) because of ut_2pow_round implementation:

      #define ut_2pow_round(n, m) ((n) & ~((m) - 1))
      
      

        Smart Checklist

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                Unassigned
                Reporter:
                Sergei Fabrichnikov
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: