Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-39976

Reduce repeated FSP_EXTENT_SIZE evaluations in InnoDB extent-descriptor functions

    XMLWordPrintable

Details

    Description

      FSP_EXTENT_SIZE is not a compile-time constant. It expands to a runtime branch
      on the global srv_page_size_shift:

        #define FSP_EXTENT_SIZE  (srv_page_size_shift < 14 ? \
                                  (1048576U >> srv_page_size_shift) : 64U)
      

      It is re-evaluated many times on hot extent-management paths,
      including inside xdes_get_n_used() (loop bound over the descriptor
      bitmap) and xdes_is_full() (which compares against it), as well as
      in the surrounding callers via XDES_SIZE /
      xdes_calc_descriptor_index() and hint % FSP_EXTENT_SIZE.

      In fsp_traverse_extents() the page descriptor of each extent is
      examined in a loop, and FSP_EXTENT_SIZE is evaluated multiple times
      per iteration (in XDES_SIZE, in xdes_calc_descriptor_index(), and
      again inside xdes_get_n_used()).

      Most callers of xdes_get_n_used() and xdes_is_full() already compute
      FSP_EXTENT_SIZE for other reasons (e.g. hint % FSP_EXTENT_SIZE,
      descriptor index arithmetic), so the value is readily available at
      the call site.

      Attachments

        Activity

          People

            thiru Thirunarayanan Balathandayuthapani
            thiru Thirunarayanan Balathandayuthapani
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0d
                0d
                Logged:
                Time Spent - 0.5h
                0.5h

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.