summaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/dlm/dlmmaster.c
diff options
context:
space:
mode:
authorTristan Ye2010-05-11 11:54:45 +0200
committerJoel Becker2010-05-18 21:31:05 +0200
commitc1631d4a484fbb498e35d661f1aebd64c86b66bf (patch)
tree06e951cfebbd616dbaa0017d1c030a3f6e0d8d88 /fs/ocfs2/dlm/dlmmaster.c
parentOcfs2: Make ocfs2_find_cpos_for_left_leaf() public. (diff)
downloadkernel-qcow2-linux-c1631d4a484fbb498e35d661f1aebd64c86b66bf.tar.gz
kernel-qcow2-linux-c1631d4a484fbb498e35d661f1aebd64c86b66bf.tar.xz
kernel-qcow2-linux-c1631d4a484fbb498e35d661f1aebd64c86b66bf.zip
Ocfs2: Optimize punching-hole code.
This patch simplifies the logic of handling existing holes and skipping extent blocks and removes some confusing comments. The patch survived the fill_verify_holes testcase in ocfs2-test. It also passed my manual sanity check and stress tests with enormous extent records. Currently punching a hole on a file with 3+ extent tree depth was really a performance disaster. It can even take several hours, though we may not hit this in real life with such a huge extent number. One simple way to improve the performance is quite straightforward. From the logic of truncate, we can punch the hole from hole_end to hole_start, which reduces the overhead of btree operations in a significant way, such as tree rotation and moving. Following is the testing result when punching hole from 0 to file end in bytes, on a 1G file, 1G file consists of 256k extent records, each record cover 4k data(just one cluster, clustersize is 4k): =========================================================================== * Original punching-hole mechanism: =========================================================================== I waited 1 hour for its completion, unfortunately it's still ongoing. =========================================================================== * Patched punching-hode mechanism: =========================================================================== real 0m2.518s user 0m0.000s sys 0m2.445s That means we've gained up to 1000 times improvement on performance in this case, whee! It's fairly cool. and it looks like that performance gain will be raising when extent records grow. The patch was based on my former 2 patches, which were about truncating codes optimization and fixup to handle CoW on punching hole. Signed-off-by: Tristan Ye <tristan.ye@oracle.com> Acked-by: Mark Fasheh <mfasheh@suse.com> Signed-off-by: Joel Becker <joel.becker@oracle.com>
Diffstat (limited to 'fs/ocfs2/dlm/dlmmaster.c')
0 files changed, 0 insertions, 0 deletions