[PATCH 15/16] xfs: only run xfs_error_test if error injection is active

Christoph Hellwig hch at infradead.org
Mon Nov 8 05:33:12 CST 2010


> Walking btree blocks during allocation checking them requires each
> block (a cache hit, so no I/O) call xfs_error_test(), which then
> does a random32() call as teh first operation.  IOWs, ~50% of the
> CPU is being consumed just testing whether we need to inject an
> error, even though error injection is not active.
> 
> Kill this overhead when error injection is not active by adding a
> global counter of active error traps and only calling into
> xfs_error_test when fault injection is active.

Looks good.  And a good reminder that we should optimize the code to not
call xfs_btree_check_block on catch matches once putting the CRC checks
into it later.

Reviewed-by: Christoph Hellwig <hch at lst.de>




More information about the xfs mailing list