From owner-svn-src-head@freebsd.org Sat Nov 11 09:34:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D2C0E6658A; Sat, 11 Nov 2017 09:34:13 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E1F877AF2D; Sat, 11 Nov 2017 09:34:12 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAB9YCGR021098; Sat, 11 Nov 2017 09:34:12 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAB9YCdE021097; Sat, 11 Nov 2017 09:34:12 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201711110934.vAB9YCdE021097@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 11 Nov 2017 09:34:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325706 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 325706 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2017 09:34:13 -0000 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; } }