svn commit: r358733 - head/sys/sys

Mateusz Guzik mjg at FreeBSD.org
Sun Mar 8 00:22:34 UTC 2020


Author: mjg
Date: Sun Mar  8 00:22:32 2020
New Revision: 358733
URL: https://svnweb.freebsd.org/changeset/base/358733

Log:
  seqc: tidy up
  
  - avoid hand-rolled read
  - match begin/end in terms of fence style

Modified:
  head/sys/sys/seqc.h

Modified: head/sys/sys/seqc.h
==============================================================================
--- head/sys/sys/seqc.h	Sat Mar  7 15:37:23 2020	(r358732)
+++ head/sys/sys/seqc.h	Sun Mar  8 00:22:32 2020	(r358733)
@@ -66,7 +66,8 @@ static __inline void
 seqc_write_end(seqc_t *seqcp)
 {
 
-	atomic_store_rel_int(seqcp, *seqcp + 1);
+	atomic_thread_fence_rel();
+	*seqcp += 1;
 	MPASS(!seqc_in_modify(*seqcp));
 	critical_exit();
 }
@@ -84,7 +85,7 @@ seqc_read(const seqc_t *seqcp)
 	seqc_t ret;
 
 	for (;;) {
-		ret = atomic_load_acq_int(__DECONST(seqc_t *, seqcp));
+		ret = seqc_read_any(seqcp);
 		if (__predict_false(seqc_in_modify(ret))) {
 			cpu_spinwait();
 			continue;


More information about the svn-src-head mailing list