zfs/include/linux
Chunwei Chen f58040c0fc Implement a proper rw_tryupgrade
Current rw_tryupgrade does rw_exit and then rw_tryenter(RW_RWITER), and then
does rw_enter(RW_READER) if it fails. This violate the assumption that
rw_tryupgrade should be atomic and could cause extra contention or even lock
inversion.

This patch we implement a proper rw_tryupgrade. For rwsem-spinlock, we take
the spinlock to check rwsem->count and rwsem->wait_list. For normal rwsem, we
use cmpxchg on rwsem->count to change the value from single reader to single
writer.

Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tim Chase <tim@chase2k.com>
Closes zfsonlinux/zfs#4692
Closes #554
2016-05-31 11:44:15 -07:00
..
Makefile.am Retire spl_module_init()/spl_module_fini() 2015-02-27 13:43:39 -08:00
bitops_compat.h Map highbit64() to fls64() 2014-10-17 15:11:50 -07:00
compiler_compat.h Refresh links to web site 2013-03-04 19:09:34 -08:00
delay_compat.h Emulate illumos interface cv_timedwait_hires() 2013-11-04 09:49:24 -08:00
file_compat.h Linux 4.7 compat: inode_lock() and friends 2016-05-20 11:00:14 -07:00
list_compat.h Refresh links to web site 2013-03-04 19:09:34 -08:00
math64_compat.h Refresh links to web site 2013-03-04 19:09:34 -08:00
mm_compat.h Linux 3.12 compat: shrinker semantics 2014-10-28 09:20:13 -07:00
proc_compat.h Refactor existing code 2015-01-16 13:55:08 -08:00
rwsem_compat.h Implement a proper rw_tryupgrade 2016-05-31 11:44:15 -07:00
wait_compat.h Remove compat includes from sys/types.h 2014-11-19 10:35:12 -08:00
zlib_compat.h Refresh links to web site 2013-03-04 19:09:34 -08:00