freebsd-dev/sys/gnu/fs/xfs
John Baldwin 4e7f640dfb Optimize sx locks to use simple atomic operations for the common cases of
obtaining and releasing shared and exclusive locks.  The algorithms for
manipulating the lock cookie are very similar to that rwlocks.  This patch
also adds support for exclusive locks using the same algorithm as mutexes.

A new sx_init_flags() function has been added so that optional flags can be
specified to alter a given locks behavior.  The flags include SX_DUPOK,
SX_NOWITNESS, SX_NOPROFILE, and SX_QUITE which are all identical in nature
to the similar flags for mutexes.

Adaptive spinning on select locks may be enabled by enabling the
ADAPTIVE_SX kernel option.  Only locks initialized with the SX_ADAPTIVESPIN
flag via sx_init_flags() will adaptively spin.

The common cases for sx_slock(), sx_sunlock(), sx_xlock(), and sx_xunlock()
are now performed inline in non-debug kernels.  As a result, <sys/sx.h> now
requires <sys/lock.h> to be included prior to <sys/sx.h>.

The new kernel option SX_NOINLINE can be used to disable the aforementioned
inlining in non-debug kernels.

The size of struct sx has changed, so the kernel ABI is probably greatly
disturbed.

MFC after:	1 month
Submitted by:	attilio
Tested by:	kris, pjd
2007-03-31 23:23:42 +00:00
..
FreeBSD Optimize sx locks to use simple atomic operations for the common cases of 2007-03-31 23:23:42 +00:00
xfs_acl.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_acl.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_ag.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_alloc_btree.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_alloc_btree.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_alloc.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_alloc.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_arch.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_attr_leaf.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_attr_leaf.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_attr_sf.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_attr.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_attr.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_behavior.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_behavior.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_bit.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_bit.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_bmap_btree.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_bmap_btree.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_bmap.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_bmap.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_btree.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_btree.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_buf_item.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_buf_item.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_cap.c
xfs_cap.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_clnt.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_da_btree.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_da_btree.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dfrag.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dfrag.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dinode.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dir2_block.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dir2_block.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dir2_data.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dir2_data.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dir2_leaf.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dir2_leaf.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dir2_node.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dir2_node.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dir2_sf.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dir2_sf.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dir2_trace.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dir2_trace.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dir2.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dir2.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dir_leaf.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dir_leaf.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dir_sf.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dir.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dir.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dmapi.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_dmops.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_error.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_error.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_extfree_item.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_extfree_item.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_fs.h Change %llx to %jx in printf() to eliminate warnings on 64-bit platforms. 2006-06-09 06:57:00 +00:00
xfs_fsops.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_fsops.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_ialloc_btree.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_ialloc_btree.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_ialloc.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_ialloc.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_iget.c More changes due to latest XFS import. 2006-06-09 06:07:42 +00:00
xfs_imap.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_inode_item.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_inode_item.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_inode.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_inode.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_inum.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_iocore.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_iomap.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_iomap.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_itable.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_itable.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_log_priv.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_log_recover.c Temporarily disable log recovery until we fix panics. 2006-06-10 23:40:58 +00:00
xfs_log_recover.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_log.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_log.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_mac.c
xfs_mac.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_mount.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_mount.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_qmops.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_quota.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_refcache.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_refcache.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_rename.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_rtalloc.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_rtalloc.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_rw.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_rw.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_sb.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_trans_ail.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_trans_buf.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_trans_extfree.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_trans_inode.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_trans_item.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_trans_priv.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_trans_space.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_trans.c Remove debugging printf 2006-06-11 00:19:00 +00:00
xfs_trans.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_types.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_utils.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_utils.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_vfsops.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs_vnodeops.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfs.h Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00
xfsidbg.c Sync XFS for FreeBSD tree with newer changes from SGI XFS for Linux tree. 2006-06-09 06:04:06 +00:00