From owner-svn-src-stable@freebsd.org Fri Jul 5 01:19:29 2019 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C1C815E2092; Fri, 5 Jul 2019 01:19:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F3B0280521; Fri, 5 Jul 2019 01:19:28 +0000 (UTC) (envelope-from kib@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BE9C631B2; Fri, 5 Jul 2019 01:19:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x651JSis006826; Fri, 5 Jul 2019 01:19:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x651JSJX006825; Fri, 5 Jul 2019 01:19:28 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201907050119.x651JSJX006825@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 5 Jul 2019 01:19:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349757 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 349757 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F3B0280521 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2019 01:19:29 -0000 Author: kib Date: Fri Jul 5 01:19:28 2019 New Revision: 349757 URL: https://svnweb.freebsd.org/changeset/base/349757 Log: MFC r349611, r349614: Style. Modified: stable/12/sys/kern/kern_umtx.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_umtx.c ============================================================================== --- stable/12/sys/kern/kern_umtx.c Fri Jul 5 01:04:58 2019 (r349756) +++ stable/12/sys/kern/kern_umtx.c Fri Jul 5 01:19:28 2019 (r349757) @@ -1059,7 +1059,6 @@ do_lock_normal(struct thread *td, struct umutex *m, ui if (owner == UMUTEX_RB_NOTRECOV) return (ENOTRECOVERABLE); - /* * Try the uncontested case. This should be * done in userland. @@ -2658,7 +2657,8 @@ do_rw_rdlock(struct thread *td, struct urwlock *rwlock /* try to lock it */ while (!(state & wrflags)) { - if (__predict_false(URWLOCK_READER_COUNT(state) == URWLOCK_MAX_READERS)) { + if (__predict_false(URWLOCK_READER_COUNT(state) == + URWLOCK_MAX_READERS)) { umtx_key_release(&uq->uq_key); return (EAGAIN); } @@ -2725,7 +2725,10 @@ do_rw_rdlock(struct thread *td, struct urwlock *rwlock } sleep: - /* contention bit is set, before sleeping, increase read waiter count */ + /* + * Contention bit is set, before sleeping, increase + * read waiter count. + */ rv = fueword32(&rwlock->rw_blocked_readers, &blocked_readers); if (rv == -1) { @@ -2829,7 +2832,8 @@ do_rw_wrlock(struct thread *td, struct urwlock *rwlock umtx_key_release(&uq->uq_key); return (EFAULT); } - while (!(state & URWLOCK_WRITE_OWNER) && URWLOCK_READER_COUNT(state) == 0) { + while ((state & URWLOCK_WRITE_OWNER) == 0 && + URWLOCK_READER_COUNT(state) == 0) { rv = casueword32(&rwlock->rw_state, state, &oldstate, state | URWLOCK_WRITE_OWNER); if (rv == -1) { @@ -2865,8 +2869,8 @@ do_rw_wrlock(struct thread *td, struct urwlock *rwlock umtxq_unlock(&uq->uq_key); /* - * re-read the state, in case it changed between the try-lock above - * and the check below + * Re-read the state, in case it changed between the + * try-lock above and the check below. */ rv = fueword32(&rwlock->rw_state, &state); if (rv == -1) @@ -2893,7 +2897,8 @@ do_rw_wrlock(struct thread *td, struct urwlock *rwlock break; } - if (!(state & URWLOCK_WRITE_OWNER) && URWLOCK_READER_COUNT(state) == 0) { + if ((state & URWLOCK_WRITE_OWNER) == 0 && + URWLOCK_READER_COUNT(state) == 0) { umtxq_unbusy_unlocked(&uq->uq_key); error = umtxq_check_susp(td); if (error != 0) @@ -2908,9 +2913,10 @@ sleep: error = EFAULT; break; } - suword32(&rwlock->rw_blocked_writers, blocked_writers+1); + suword32(&rwlock->rw_blocked_writers, blocked_writers + 1); - while ((state & URWLOCK_WRITE_OWNER) || URWLOCK_READER_COUNT(state) != 0) { + while ((state & URWLOCK_WRITE_OWNER) || + URWLOCK_READER_COUNT(state) != 0) { umtxq_lock(&uq->uq_key); umtxq_insert_queue(uq, UMTX_EXCLUSIVE_QUEUE); umtxq_unbusy(&uq->uq_key);