linux_dsm_epyc7002/fs/xfs
Dave Chinner 11ef38afe9 xfs: make xfs btree stats less huge
Embedding a switch statement in every btree stats inc/add adds a lot
of code overhead to the core btree infrastructure paths. Stats are
supposed to be small and lightweight, but the btree stats have
become big and bloated as we've added more btrees. It needs fixing
because the reflink code will just add more overhead again.

Convert the v2 btree stats to arrays instead of independent
variables, and instead use the type to index the specific btree
array via an enum. This allows us to use array based indexing
to update the stats, rather than having to derefence variables
specific to the btree type.

If we then wrap the xfsstats structure in a union and place uint32_t
array beside it, and calculate the correct btree stats array base
array index when creating a btree cursor,  we can easily access
entries in the stats structure without having to switch names based
on the btree type.

We then replace with the switch statement with a simple set of stats
wrapper macros, resulting in a significant simplification of the
btree stats code, and:

   text	   data	    bss	    dec	    hex	filename
  48905	    144	      8	  49057	   bfa1	fs/xfs/libxfs/xfs_btree.o.old
  36793	    144	      8	  36945	   9051	fs/xfs/libxfs/xfs_btree.o

it reduces the core btree infrastructure code size by close to 25%!

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2016-12-05 14:38:58 +11:00
..
libxfs xfs: make xfs btree stats less huge 2016-12-05 14:38:58 +11:00
Kconfig
kmem.c
kmem.h
Makefile
mrlock.h
uuid.c
uuid.h
xfs_acl.c
xfs_acl.h
xfs_aops.c xfs: cleanup xfs_reflink_find_cow_mapping 2016-11-24 11:39:49 +11:00
xfs_aops.h
xfs_attr_inactive.c
xfs_attr_list.c xfs: several xattr functions can be void 2016-12-05 12:32:14 +11:00
xfs_attr.h xfs: several xattr functions can be void 2016-12-05 12:32:14 +11:00
xfs_bmap_item.c
xfs_bmap_item.h
xfs_bmap_util.c xfs: provide helper for counting extents from if_bytes 2016-11-08 12:59:42 +11:00
xfs_bmap_util.h
xfs_buf_item.c
xfs_buf_item.h
xfs_buf.c
xfs_buf.h xfs: add XBF_XBF_NO_IOACCT to buf trace output 2016-11-28 14:57:42 +11:00
xfs_dir2_readdir.c
xfs_discard.c
xfs_discard.h
xfs_dquot_item.c
xfs_dquot_item.h
xfs_dquot.c
xfs_dquot.h
xfs_error.c
xfs_error.h
xfs_export.c
xfs_export.h
xfs_extent_busy.c
xfs_extent_busy.h
xfs_extfree_item.c
xfs_extfree_item.h
xfs_file.c xfs: don't cap maximum dedupe request length 2016-12-05 12:38:57 +11:00
xfs_filestream.c
xfs_filestream.h
xfs_fsops.c
xfs_fsops.h
xfs_globals.c
xfs_icache.c xfs: fix unbalanced inode reclaim flush locking 2016-11-10 08:23:22 +11:00
xfs_icache.h
xfs_icreate_item.c fs: xfs: xfs_icreate_item: constify xfs_item_ops structure 2016-11-28 14:57:42 +11:00
xfs_icreate_item.h
xfs_inode_item.c xfs: provide helper for counting extents from if_bytes 2016-11-08 12:59:42 +11:00
xfs_inode_item.h
xfs_inode.c xfs: Move AGI buffer type setting to xfs_read_agi 2016-12-05 12:31:31 +11:00
xfs_inode.h xfs: fix unbalanced inode reclaim flush locking 2016-11-10 08:23:22 +11:00
xfs_ioctl32.c
xfs_ioctl32.h
xfs_ioctl.c xfs: provide helper for counting extents from if_bytes 2016-11-08 12:59:42 +11:00
xfs_ioctl.h
xfs_iomap.c xfs: pass post-eof speculative prealloc blocks to bmapi 2016-11-28 14:57:42 +11:00
xfs_iomap.h
xfs_iops.c
xfs_iops.h
xfs_itable.c
xfs_itable.h
xfs_linux.h
xfs_log_cil.c
xfs_log_priv.h
xfs_log_recover.c xfs: Move AGI buffer type setting to xfs_read_agi 2016-12-05 12:31:31 +11:00
xfs_log.c
xfs_log.h
xfs_message.c
xfs_message.h
xfs_mount.c
xfs_mount.h
xfs_mru_cache.c
xfs_mru_cache.h
xfs_ondisk.h
xfs_pnfs.c
xfs_pnfs.h
xfs_qm_bhv.c
xfs_qm_syscalls.c
xfs_qm.c xfs: provide helper for counting extents from if_bytes 2016-11-08 12:59:42 +11:00
xfs_qm.h
xfs_quota.h
xfs_quotaops.c
xfs_refcount_item.c
xfs_refcount_item.h
xfs_reflink.c xfs: clean up cow fork reservation and tag inodes correctly 2016-11-28 14:57:42 +11:00
xfs_reflink.h xfs: use new extent lookup helpers in xfs_reflink_trim_irec_to_next_cow 2016-11-24 11:39:50 +11:00
xfs_rmap_item.c
xfs_rmap_item.h
xfs_rtalloc.c
xfs_rtalloc.h
xfs_stats.c xfs: make xfs btree stats less huge 2016-12-05 14:38:58 +11:00
xfs_stats.h xfs: make xfs btree stats less huge 2016-12-05 14:38:58 +11:00
xfs_super.c
xfs_super.h
xfs_symlink.c
xfs_symlink.h
xfs_sysctl.c
xfs_sysctl.h
xfs_sysfs.c
xfs_sysfs.h
xfs_trace.c
xfs_trace.h
xfs_trans_ail.c
xfs_trans_bmap.c
xfs_trans_buf.c
xfs_trans_dquot.c
xfs_trans_extfree.c
xfs_trans_inode.c
xfs_trans_priv.h
xfs_trans_refcount.c
xfs_trans_rmap.c
xfs_trans.c
xfs_trans.h
xfs_xattr.c xfs: several xattr functions can be void 2016-12-05 12:32:14 +11:00
xfs.h