[Ocfs2-tools-devel] [PATCH 09/11] fsck.ocfs2: Improve performance of Pass 0

Sunil Mushran sunil.mushran at oracle.com
Fri Sep 30 12:22:19 PDT 2011


In Pass 0, fsck reads and verifies all the chain allocators. This patch improves
the performance of this pass by making use of ocfs2_cache_chain_allocator_blocks()
to read in all the chained groups before verifying the contents of those groups.

The test was run on a 2TB volume having 15M files. The cache size was 820MB.

Before:
Pass 0a: Checking cluster allocation chains
  I/O read disk/cache: 66MB / 1MB, write: 0MB, rate: 0.68MB/s
  Times real: 97.061s, user: 0.251s, sys: 0.278s
Pass 0b: Checking inode allocation chains
  I/O read disk/cache: 64MB / 127MB, write: 0MB, rate: 2.64MB/s
  Times real: 71.872s, user: 1.571s, sys: 0.499s
Pass 0c: Checking extent block allocation chains
  I/O read disk/cache: 3MB / 1MB, write: 0MB, rate: 1.60MB/s
  Times real: 1.878s, user: 0.043s, sys: 0.008s

After:
Pass 0a: Checking cluster allocation chains
  I/O read disk/cache: 66MB / 66MB, write: 0MB, rate: 10.58MB/s
  Times real: 12.377s, user: 0.260s, sys: 0.182s
Pass 0b: Checking inode allocation chains
  I/O read disk/cache: 64MB / 190MB, write: 0MB, rate: 32.40MB/s
  Times real: 7.808s, user: 1.279s, sys: 0.337s
Pass 0c: Checking extent block allocation chains
  I/O read disk/cache: 3MB / 3MB, write: 0MB, rate: 20.33MB/s
  Times real: 0.246s, user: 0.036s, sys: 0.004s

Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com>
---
 fsck.ocfs2/pass0.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/fsck.ocfs2/pass0.c b/fsck.ocfs2/pass0.c
index 6187d77..68b151c 100644
--- a/fsck.ocfs2/pass0.c
+++ b/fsck.ocfs2/pass0.c
@@ -1334,6 +1334,11 @@ errcode_t o2fsck_pass0(o2fsck_state *ost)
 		}
 	}
 
+	/* Warm up the cache with the groups */
+	ret = ocfs2_cache_chain_allocator_blocks(fs, di);
+	if (ret)
+		verbosef("Caching global bitmap failed, err %d\n", ret);
+
 retry_bitmap:
 	pre_repair_clusters = di->i_clusters;
 	ret = verify_bitmap_descs(ost, di, blocks + ost->ost_fs->fs_blocksize,
@@ -1410,6 +1415,11 @@ retry_bitmap:
 		verbosef("found inode alloc %"PRIu64" at block %"PRIu64"\n",
 			 (uint64_t)di->i_blkno, blkno);
 
+		/* Warm up the cache with the groups */
+		ret = ocfs2_cache_chain_allocator_blocks(fs, di);
+		if (ret)
+			verbosef("Caching inode alloc failed, err %d\n", ret);
+
 		ret = verify_chain_alloc(ost, di,
 					 blocks + ost->ost_fs->fs_blocksize,
 					 blocks + 
@@ -1469,6 +1479,11 @@ retry_bitmap:
 		verbosef("found extent alloc %"PRIu64" at block %"PRIu64"\n",
 			 (uint64_t)di->i_blkno, blkno);
 
+		/* Warm up the cache with the groups */
+		ret = ocfs2_cache_chain_allocator_blocks(fs, di);
+		if (ret)
+			verbosef("Caching extent alloc failed, err %d\n", ret);
+
 		ret = verify_chain_alloc(ost, di,
 					 blocks + ost->ost_fs->fs_blocksize,
 					 blocks + 
-- 
1.7.4.1




More information about the Ocfs2-tools-devel mailing list