]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit - libxfs/xfs_bmap.c
xfs: bmapbt checking on debug kernels too expensive
authorDave Chinner <dchinner@redhat.com>
Wed, 17 Feb 2016 05:44:57 +0000 (16:44 +1100)
committerDave Chinner <david@fromorbit.com>
Wed, 17 Feb 2016 05:44:57 +0000 (16:44 +1100)
commitf07ae2a662c1cb6d10481b73ec7a3f5f02ab2ae9
tree8649d9f31da16f61298c59b3c64a71cc564bdb74
parent65ca3804f81ff516056c1822e2817707c167630e
xfs: bmapbt checking on debug kernels too expensive

Source kernel commit e35438196c6a1d8b206471d51e80c380e80e047b

For large sparse or fragmented files, checking every single entry in
the bmapbt on every operation is prohibitively expensive. Especially
as such checks rarely discover problems during normal operations on
high extent coutn files. Our regression tests don't tend to exercise
files with hundreds of thousands to millions of extents, so mostly
this isn't noticed.

However, trying to run things like xfs_mdrestore of large filesystem
dumps on a debug kernel quickly becomes impossible as the CPU is
completely burnt up repeatedly walking the sparse file bmapbt that
is generated for every allocation that is made.

Hence, if the file has more than 10,000 extents, just don't bother
with walking the tree to check it exhaustively. The btree code has
checks that ensure that the newly inserted/removed/modified record
is correctly ordered, so the entrie tree walk in thses cases has
limited additional value.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
libxfs/xfs_bmap.c