svn commit: r351323 - head/sys/sys

Mateusz Guzik mjg at FreeBSD.org
Wed Aug 21 04:54:49 UTC 2019


Author: mjg
Date: Wed Aug 21 04:54:48 2019
New Revision: 351323
URL: https://svnweb.freebsd.org/changeset/base/351323

Log:
  seqc: predict false for _in_modify and type fixes for _consistent_*
  
  seqc_consistent_* return bool, not seqc. [0]
  
  While here annotate the rarely true condition - it is expected to run
  into it on vare occasion (compared to the other case).
  
  Reported by:	oshogbo [0]
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/sys/seqc.h

Modified: head/sys/sys/seqc.h
==============================================================================
--- head/sys/sys/seqc.h	Wed Aug 21 02:26:22 2019	(r351322)
+++ head/sys/sys/seqc.h	Wed Aug 21 04:54:48 2019	(r351323)
@@ -78,7 +78,7 @@ seqc_read(const seqc_t *seqcp)
 
 	for (;;) {
 		ret = atomic_load_acq_int(__DECONST(seqc_t *, seqcp));
-		if (seqc_in_modify(ret)) {
+		if (__predict_false(seqc_in_modify(ret))) {
 			cpu_spinwait();
 			continue;
 		}
@@ -88,14 +88,14 @@ seqc_read(const seqc_t *seqcp)
 	return (ret);
 }
 
-static __inline seqc_t
+static __inline bool
 seqc_consistent_nomb(const seqc_t *seqcp, seqc_t oldseqc)
 {
 
 	return (*seqcp == oldseqc);
 }
 
-static __inline seqc_t
+static __inline bool
 seqc_consistent(const seqc_t *seqcp, seqc_t oldseqc)
 {
 


More information about the svn-src-all mailing list