mirror_zfs/module/splat
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.in Support parallel build trees (VPATH builds) 2015-07-17 12:53:11 -07:00
splat-atomic.c Add defclsyspri macro 2015-07-23 13:25:49 -07:00
splat-condvar.c Don't hold mutex until release cv in cv_wait 2016-01-12 15:18:44 -08:00
splat-cred.c splat cred:groupmember: Fix false positives 2014-04-08 12:44:41 -07:00
splat-ctl.c Linux 4.2 compat: misc_deregister() 2015-09-01 09:20:45 -07:00
splat-generic.c Remove compat includes from sys/types.h 2014-11-19 10:35:12 -08:00
splat-internal.h Linux 4.2 compat: vfs_rename() 2015-08-19 16:03:29 -07:00
splat-kmem.c Limit maximum object size in kmem tests 2015-11-16 15:02:24 -08:00
splat-kobj.c Refresh links to web site 2013-03-04 19:09:34 -08:00
splat-linux.c Remove compat includes from sys/types.h 2014-11-19 10:35:12 -08:00
splat-list.c Refresh links to web site 2013-03-04 19:09:34 -08:00
splat-mutex.c Add defclsyspri macro 2015-07-23 13:25:49 -07:00
splat-random.c Refresh links to web site 2013-03-04 19:09:34 -08:00
splat-rwlock.c Implement a proper rw_tryupgrade 2016-05-31 11:44:15 -07:00
splat-taskq.c Add defclsyspri macro 2015-07-23 13:25:49 -07:00
splat-thread.c Add defclsyspri macro 2015-07-23 13:25:49 -07:00
splat-time.c Remove compat includes from sys/types.h 2014-11-19 10:35:12 -08:00
splat-vnode.c Linux 4.2 compat: vfs_rename() 2015-08-19 16:03:29 -07:00
splat-zlib.c Refactor existing code 2015-01-16 13:55:08 -08:00