svn commit: r309751 - head/sys/kern

Gleb Smirnoff glebius at FreeBSD.org
Fri Dec 9 19:07:32 UTC 2016


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.


More information about the svn-src-head mailing list