xfs
[Top] [All Lists]

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

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 15/16] xfs: only run xfs_error_test if error injection is active
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Mon, 8 Nov 2010 06:33:12 -0500
Cc: xfs@xxxxxxxxxxx
In-reply-to: <1289206519-18377-16-git-send-email-david@xxxxxxxxxxxxx>
References: <1289206519-18377-1-git-send-email-david@xxxxxxxxxxxxx> <1289206519-18377-16-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
> 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@xxxxxx>

<Prev in Thread] Current Thread [Next in Thread>