From owner-svn-src-all@freebsd.org Fri Dec 9 19:07:32 2016 Return-Path: Delivered-To: svn-src-all@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 91E69C6E125; Fri, 9 Dec 2016 19:07:32 +0000 (UTC) (envelope-from glebius@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 61711FB; Fri, 9 Dec 2016 19:07:32 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB9J7VeX015908; Fri, 9 Dec 2016 19:07:31 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB9J7VHu015907; Fri, 9 Dec 2016 19:07:31 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201612091907.uB9J7VHu015907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 9 Dec 2016 19:07:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309751 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2016 19:07:32 -0000 Author: glebius Date: Fri Dec 9 19:07:31 2016 New Revision: 309751 URL: https://svnweb.freebsd.org/changeset/base/309751 Log: Use acquire write to cr_lock to complement with release write at end of locked region. Submitted by: kib Modified: head/sys/kern/subr_counter.c Modified: head/sys/kern/subr_counter.c ============================================================================== --- head/sys/kern/subr_counter.c Fri Dec 9 18:55:27 2016 (r309750) +++ head/sys/kern/subr_counter.c Fri Dec 9 19:07:31 2016 (r309751) @@ -144,7 +144,7 @@ counter_ratecheck(struct counter_rate *c * First try unlocked read, and then proceed with atomic. */ if ((cr->cr_lock == 0) && - atomic_cmpset_int(&cr->cr_lock, 0, 1)) { + atomic_cmpset_acq_int(&cr->cr_lock, 0, 1)) { /* * Check if other thread has just went through the * reset sequence before us.