Whamcloud - gitweb
LU-14033 ldiskfs: Fix mballoc prefetch patch 94/44894/3
authorShaun Tancheff <shaun.tancheff@hpe.com>
Sat, 11 Sep 2021 07:59:32 +0000 (02:59 -0500)
committerOleg Drokin <green@whamcloud.com>
Wed, 22 Sep 2021 04:44:51 +0000 (04:44 +0000)
ext4-mballoc-prefetch patch was inadvertently broken during patch
rebasing.

In ext4_read_block_bitmap():
    ext4_read_block_bitmap_nowait() should not ignore locked

Test-Parameters: trivial
HPE-bug-id: LUS-9805
Fixes: fc87b01f96e8 ("LU-12477 ldiskfs: remove obsolete ext4 patches")
Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Change-Id: I6ebe9dfe48f48706da3623e3d32d33dddf35b395
Reviewed-on: https://review.whamcloud.com/44894
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
ldiskfs/kernel_patches/patches/rhel7.6/ext4-mballoc-prefetch.patch

index adeb497..5e4cd06 100644 (file)
@@ -29,7 +29,7 @@
        int err;
  
 -      bh = ext4_read_block_bitmap_nowait(sb, block_group);
-+      bh = ext4_read_block_bitmap_nowait(sb, block_group, 1);
++      bh = ext4_read_block_bitmap_nowait(sb, block_group, 0);
        if (!bh)
                return NULL;
        err = ext4_wait_block_bitmap(sb, block_group, bh);
        return err;
  }
  
-@@ -2832,6 +2925,22 @@ int ext4_mb_init(struct super_block *
+@@ -2832,6 +2925,24 @@ int ext4_mb_init(struct super_block *
                sbi->s_mb_large_req = sbi->s_stripe * 8;
                sbi->s_mb_group_prealloc = sbi->s_stripe * 4;
        }
 +       * load too many groups, at some point we should start to use what
 +       * we've got in memory.
 +       * with an average random access time 5ms, it'd take a second to get
-+       * 200 groups (* N with flex_bg), so let's make this limit 32 */
-+      sbi->s_mb_prefetch_limit = sbi->s_mb_prefetch * 32;
++       * 200 groups (* N with flex_bg), so let's make this limit 4 */
++      sbi->s_mb_prefetch_limit = sbi->s_mb_prefetch * 4;
++      if (sbi->s_mb_prefetch_limit > ext4_get_groups_count(sb))
++              sbi->s_mb_prefetch_limit = ext4_get_groups_count(sb);
  
        sbi->s_locality_groups = alloc_percpu(struct ext4_locality_group);
        if (sbi->s_locality_groups == NULL) {