]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_repair: multithread phase 2
authorDave Chinner <dchinner@redhat.com>
Thu, 6 Jan 2011 10:20:25 +0000 (21:20 +1100)
committerDave Chinner <david@fromorbit.com>
Thu, 6 Jan 2011 10:20:25 +0000 (21:20 +1100)
commit364a126c64487dafdac11a65bf58d9162c37704c
tree20f81fbd52f450e917c4e5e29e3195804bf518ee
parent0335a835729ce5da6890de1634814240c497dff7
xfs_repair: multithread phase 2

Running some recent repair tests on broken filesystem meant running
phase 1 and 2 repeatedly to reproduce an issue at the start of phase
3. Phase 2 was taking approximately 10 minutes to run as it
processes each AG serially.

Phase 2 can be trivially parallelised - it is simply scanning the
per AG trees to calculate free block counts and free and used inodes
counts. This can be done safely in parallel by giving each AG it's
own structure to aggregate counts into, then once the AG scan is
complete adding them all together.

This patch uses 32-way threading which results in no noticable
slowdown on single SATA drives with NCQ, but results in ~10x
reduction in runtime on a 12 disk RAID-0 array.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
repair/phase2.c
repair/scan.c
repair/scan.h
repair/xfs_repair.c