Files
mirror_zfs/include/sys
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
..
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2014-10-17 15:11:50 -07:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2016-02-25 11:42:46 -08:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2014-10-17 15:11:51 -07:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2015-06-24 14:44:47 -07:00
2013-03-04 19:09:34 -08:00
2013-10-09 13:52:55 -07:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2016-05-31 09:05:56 -07:00
2013-03-04 19:09:34 -08:00
2015-10-13 09:50:40 -07:00
2013-10-25 13:41:52 -07:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2016-04-25 17:04:07 -07:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2016-05-31 11:44:15 -07:00
2013-10-09 14:20:46 -07:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2016-02-25 11:42:46 -08:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2014-04-14 09:04:41 -07:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2014-04-09 19:17:12 -07:00
2014-04-14 09:32:01 -07:00
2016-01-20 13:07:45 -08:00
2013-03-04 19:09:34 -08:00
2016-01-20 11:39:18 -08:00
2013-03-04 19:09:34 -08:00
2015-08-24 10:10:21 -07:00
2013-03-04 19:09:34 -08:00
2015-12-03 15:44:47 -08:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2013-03-04 19:09:34 -08:00
2015-04-24 13:02:37 -07:00
2013-03-04 19:09:34 -08:00
2015-04-02 09:49:55 -07:00