From owner-svn-src-all@freebsd.org Fri Nov 25 17:20:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 151D0C5431F; Fri, 25 Nov 2016 17:20:25 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D8C56BCC; Fri, 25 Nov 2016 17:20:24 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAPHKOl6026673; Fri, 25 Nov 2016 17:20:24 GMT (envelope-from fabient@FreeBSD.org) Received: (from fabient@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAPHKOUe026672; Fri, 25 Nov 2016 17:20:24 GMT (envelope-from fabient@FreeBSD.org) Message-Id: <201611251720.uAPHKOUe026672@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fabient set sender to fabient@FreeBSD.org using -f From: Fabien Thomas Date: Fri, 25 Nov 2016 17:20:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309146 - head/sys/libkern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Nov 2016 17:20:25 -0000 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;