linux/fs/xfs
Dave Chinner c76febef57 xfs: only run xfs_error_test if error injection is active
Recent tests writing lots of small files showed the flusher thread
being CPU bound and taking a long time to do allocations on a debug
kernel. perf showed this as the prime reason:

             samples  pcnt function                    DSO
             _______ _____ ___________________________ _________________

           224648.00 36.8% xfs_error_test              [kernel.kallsyms]
            86045.00 14.1% xfs_btree_check_sblock      [kernel.kallsyms]
            39778.00  6.5% prandom32                   [kernel.kallsyms]
            37436.00  6.1% xfs_btree_increment         [kernel.kallsyms]
            29278.00  4.8% xfs_btree_get_rec           [kernel.kallsyms]
            27717.00  4.5% random32                    [kernel.kallsyms]

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 the 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.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2010-12-01 07:40:20 -06:00
..
linux-2.6 xfs: push stale, pinned buffers on trylock failures 2010-12-01 07:40:20 -06:00
quota xfs: Extend project quotas to support 32bit project ids 2010-10-18 15:08:08 -05:00
support
Kconfig quota: Make QUOTACTL config be selected by its users 2010-10-05 12:16:37 +02:00
Makefile
xfs.h
xfs_acl.h
xfs_ag.h xfs: convert buffer cache hash to rbtree 2010-10-18 15:07:56 -05:00
xfs_alloc.c xfs: eliminate some newly-reported gcc warnings 2010-10-18 15:07:39 -05:00
xfs_alloc.h
xfs_alloc_btree.c xfs: remove the ->kill_root btree operation 2010-10-18 15:07:38 -05:00
xfs_alloc_btree.h
xfs_arch.h
xfs_attr.c xfs: remove xfs_buf wrappers 2010-10-18 15:08:07 -05:00
xfs_attr.h
xfs_attr_leaf.c
xfs_attr_leaf.h
xfs_attr_sf.h
xfs_bit.c
xfs_bit.h
xfs_bmap.c xfs: delayed alloc blocks beyond EOF are valid after writeback 2010-12-01 07:40:20 -06:00
xfs_bmap.h xfs: fix failed write truncation handling. 2010-12-01 07:40:19 -06:00
xfs_bmap_btree.c
xfs_bmap_btree.h
xfs_btree.c xfs: remove xfs_buf wrappers 2010-10-18 15:08:07 -05:00
xfs_btree.h xfs: remove the ->kill_root btree operation 2010-10-18 15:07:38 -05:00
xfs_btree_trace.c
xfs_btree_trace.h
xfs_buf_item.c xfs: remove xfs_buf wrappers 2010-10-18 15:08:07 -05:00
xfs_buf_item.h
xfs_da_btree.c xfs: remove xfs_buf wrappers 2010-10-18 15:08:07 -05:00
xfs_da_btree.h
xfs_dfrag.c xfs: delayed alloc blocks beyond EOF are valid after writeback 2010-12-01 07:40:20 -06:00
xfs_dfrag.h
xfs_dinode.h xfs: Extend project quotas to support 32bit project ids 2010-10-18 15:08:08 -05:00
xfs_dir2.c
xfs_dir2.h
xfs_dir2_block.c
xfs_dir2_block.h
xfs_dir2_data.c
xfs_dir2_data.h
xfs_dir2_leaf.c xfs: remove xfs_buf wrappers 2010-10-18 15:08:07 -05:00
xfs_dir2_leaf.h
xfs_dir2_node.c
xfs_dir2_node.h
xfs_dir2_sf.c
xfs_dir2_sf.h
xfs_error.c xfs: only run xfs_error_test if error injection is active 2010-12-01 07:40:20 -06:00
xfs_error.h xfs: only run xfs_error_test if error injection is active 2010-12-01 07:40:20 -06:00
xfs_extfree_item.c
xfs_extfree_item.h
xfs_filestream.c xfs: tell lockdep about parent iolock usage in filestreams 2010-11-10 12:00:48 -06:00
xfs_filestream.h
xfs_fs.h xfs: Extend project quotas to support 32bit project ids 2010-10-18 15:08:08 -05:00
xfs_fsops.c xfs: do not use xfs_mod_incore_sb for per-cpu counters 2010-10-18 15:07:59 -05:00
xfs_fsops.h xfs: dummy transactions should not dirty VFS state 2010-08-24 11:46:31 +10:00
xfs_ialloc.c xfs: remove xfs_buf wrappers 2010-10-18 15:08:07 -05:00
xfs_ialloc.h
xfs_ialloc_btree.c xfs: remove the ->kill_root btree operation 2010-10-18 15:07:38 -05:00
xfs_ialloc_btree.h
xfs_iget.c xfs: fix bogus m_maxagi check in xfs_iget 2010-10-18 15:08:01 -05:00
xfs_inode.c xfs: Extend project quotas to support 32bit project ids 2010-10-18 15:08:08 -05:00
xfs_inode.h new helper: ihold() 2010-10-25 21:26:11 -04:00
xfs_inode_item.c xfs: avoid moving stale inodes in the AIL 2010-12-01 07:40:20 -06:00
xfs_inode_item.h
xfs_inum.h
xfs_iomap.c
xfs_iomap.h
xfs_itable.c xfs: Extend project quotas to support 32bit project ids 2010-10-18 15:08:08 -05:00
xfs_itable.h
xfs_log.c Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs 2010-10-22 17:32:27 -07:00
xfs_log.h
xfs_log_cil.c xfs: reduce the number of CIL lock round trips during commit 2010-10-18 15:07:42 -05:00
xfs_log_priv.h xfs: force background CIL push under sustained load 2010-09-29 07:51:03 -05:00
xfs_log_recover.c xfs: remove xfs_buf wrappers 2010-10-18 15:08:07 -05:00
xfs_log_recover.h
xfs_mount.c xfs: fix per-ag reference counting in inode reclaim tree walking 2010-11-10 12:00:48 -06:00
xfs_mount.h xfs: remove xfs_cred.h 2010-10-18 15:08:06 -05:00
xfs_mru_cache.c
xfs_mru_cache.h
xfs_quota.h xfs: fix a few compiler warnings with CONFIG_XFS_QUOTA=n 2010-11-10 12:00:48 -06:00
xfs_rename.c xfs: Extend project quotas to support 32bit project ids 2010-10-18 15:08:08 -05:00
xfs_rtalloc.c xfs: use unhashed buffers for size checks 2010-10-18 15:07:50 -05:00
xfs_rtalloc.h
xfs_rw.c
xfs_rw.h
xfs_sb.h xfs: Extend project quotas to support 32bit project ids 2010-10-18 15:08:08 -05:00
xfs_trans.c xfs: fix the xfs_trans_committed 2010-10-18 15:08:02 -05:00
xfs_trans.h xfs: remove unused t_callback field in struct xfs_trans 2010-10-18 15:08:01 -05:00
xfs_trans_ail.c
xfs_trans_buf.c xfs: remove xfs_buf wrappers 2010-10-18 15:08:07 -05:00
xfs_trans_extfree.c
xfs_trans_inode.c xfs: don't use vfs writeback for pure metadata modifications 2010-10-18 15:07:45 -05:00
xfs_trans_priv.h xfs: unlock items before allowing the CIL to commit 2010-08-24 11:42:52 +10:00
xfs_trans_space.h
xfs_types.h xfs: Extend project quotas to support 32bit project ids 2010-10-18 15:08:08 -05:00
xfs_utils.c xfs: remove xfs_cred.h 2010-10-18 15:08:06 -05:00
xfs_utils.h xfs: remove xfs_cred.h 2010-10-18 15:08:06 -05:00
xfs_vnodeops.c xfs: Extend project quotas to support 32bit project ids 2010-10-18 15:08:08 -05:00
xfs_vnodeops.h xfs: remove xfs_cred.h 2010-10-18 15:08:06 -05:00