svn commit: r309146 - head/sys/libkern

Fabien Thomas fabient at FreeBSD.org
Fri Nov 25 17:20:25 UTC 2016


Author: fabient
Date: Fri Nov 25 17:20:23 2016
New Revision: 309146
URL: https://svnweb.freebsd.org/changeset/base/309146

Log:
  Update r309143 to prevent false sharing.
  
  Reported by:	mjg
  Approved by:	so
  MFC after:	1 month

Modified:
  head/sys/libkern/arc4random.c

Modified: head/sys/libkern/arc4random.c
==============================================================================
--- head/sys/libkern/arc4random.c	Fri Nov 25 16:04:36 2016	(r309145)
+++ head/sys/libkern/arc4random.c	Fri Nov 25 17:20:23 2016	(r309146)
@@ -31,13 +31,13 @@ int arc4rand_iniseed_state = ARC4_ENTR_N
 MALLOC_DEFINE(M_ARC4RANDOM, "arc4random", "arc4random structures");
 
 struct arc4_s {
+	struct mtx mtx;
 	u_int8_t i, j;
 	int numruns;
 	u_int8_t sbox[256];
 	time_t t_reseed;
 
-	struct mtx mtx;
-};
+} __aligned(CACHE_LINE_SIZE);
 
 static struct arc4_s *arc4inst = NULL;
 


More information about the svn-src-head mailing list