Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Nov 2016 17:20:24 +0000 (UTC)
From:      Fabien Thomas <fabient@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r309146 - head/sys/libkern
Message-ID:  <201611251720.uAPHKOUe026672@repo.freebsd.org>

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



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