Whamcloud - gitweb
LU-16750 ldiskfs: optimize metadata allocation for hybrid LUNs 25/51625/7
authorBobi Jam <bobijam@whamcloud.com>
Mon, 10 Jul 2023 11:40:34 +0000 (19:40 +0800)
committerBobi Jam <bobijam@whamcloud.com>
Mon, 28 Aug 2023 03:53:48 +0000 (11:53 +0800)
commit452f102a581f2a8ef8396bf0ba5584d61512a267
tree3d900834eae43cd2cb84ccac8b9f2151bad97126
parent8da59fc988f0cebcac10e8ef1faab1e4c913de03
LU-16750 ldiskfs: optimize metadata allocation for hybrid LUNs

With LVM it is possible to create an LV with SSD storage at the
beginning of the LV and HDD storage at the end of the LV, and use that
to separate ext4 metadata allocations (that need small random IOs)
from data allocations (that are better suited for large sequential
IOs) depending on the type of underlying storage.  Between 0.5-1.0% of
the filesystem capacity would need to be high-IOPS storage in order to
hold all of the internal metadata.

This would improve performance for inode and other metadata access,
such as ls, find, e2fsck, and in general improve file access latency,
modification, truncate, unlink, transaction commit, etc.

This patch split largest free order group lists and average fragment
size lists into other two lists for IOPS/fast storage groups, and
cr 0 / cr 1 group scanning for metadata block allocation in following
order:

if (allocate metadata blocks)
      if (cr ==0) try to find group in largest free order IOPS group
                  list
      if (cr ==1 or failed to find group in largest free order IOPS
          group)
                 try to find group in fragment size IOPS group list
      if (above two find failed)
                 fall through normal group lists as before
if (allocate data blocks)
      try to find group in normal group lists as before
      if (failed to find group in normal group)
                 try to find group in IOPS groups

Non-metadata block allocation does not allocate from the IOPS groups
if non-IOPS groups are not used up.

Add for mke2fs an option to mark which blocks are in the IOPS region
of storage at format time:

  -E iops=0-1024G,4096-8192G

so the ext4 mballoc code can then use the EXT4_BG_IOPS flag in the
group descriptors to decide which groups to allocate dynamic
filesystem metadata.

--
v2->v3: add sysfs mb_enable_iops to disable/enable this feature
v1->v2: for metadata block allocation, search in IOPS list then normal
        list; for data block allocation, search in normal list then
        IOPS list.

        Try to create new inode from IOPS group.

Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Change-Id: Ice2d25b8db19f67e70690f9ccebc419f253b12bd
ldiskfs/kernel_patches/patches/rhel8/ext4-mballoc-for-hybrid.patch [new file with mode: 0644]
ldiskfs/kernel_patches/series/ldiskfs-4.18-rhel8.8.series