Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Nov 2017 09:34:12 +0000 (UTC)
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r325706 - head/sys/kern
Message-ID:  <201711110934.vAB9YCdE021097@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mjg
Date: Sat Nov 11 09:34:11 2017
New Revision: 325706
URL: https://svnweb.freebsd.org/changeset/base/325706

Log:
  rwlock: use fcmpset for setting RW_LOCK_WRITE_SPINNER

Modified:
  head/sys/kern/kern_rwlock.c

Modified: head/sys/kern/kern_rwlock.c
==============================================================================
--- head/sys/kern/kern_rwlock.c	Sat Nov 11 07:21:49 2017	(r325705)
+++ head/sys/kern/kern_rwlock.c	Sat Nov 11 09:34:11 2017	(r325706)
@@ -929,9 +929,8 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v, ui
 		if ((v & RW_LOCK_READ) && RW_READERS(v) &&
 		    spintries < rowner_retries) {
 			if (!(v & RW_LOCK_WRITE_SPINNER)) {
-				if (!atomic_cmpset_ptr(&rw->rw_lock, v,
+				if (!atomic_fcmpset_ptr(&rw->rw_lock, &v,
 				    v | RW_LOCK_WRITE_SPINNER)) {
-					v = RW_READ_VALUE(rw);
 					continue;
 				}
 			}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201711110934.vAB9YCdE021097>