Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Aug 2019 04:54:48 +0000 (UTC)
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r351323 - head/sys/sys
Message-ID:  <201908210454.x7L4smIa085103@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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)
 {
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201908210454.x7L4smIa085103>