From owner-svn-src-head@freebsd.org Wed Sep 6 20:32:51 2017 Return-Path: Delivered-To: svn-src-head@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 B9E26E15B14; Wed, 6 Sep 2017 20:32:51 +0000 (UTC) (envelope-from mjg@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 0A5E17CB80; Wed, 6 Sep 2017 20:32:50 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v86KWo67041819; Wed, 6 Sep 2017 20:32:50 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v86KWngu041817; Wed, 6 Sep 2017 20:32:49 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201709062032.v86KWngu041817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 6 Sep 2017 20:32:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323235 - in head/sys: conf sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: conf sys X-SVN-Commit-Revision: 323235 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Sep 2017 20:32:52 -0000 Author: mjg Date: Wed Sep 6 20:32:49 2017 New Revision: 323235 URL: https://svnweb.freebsd.org/changeset/base/323235 Log: Introduce __read_frequently While __read_mostly groups variables together, their placement is not specified. In particular 2 frequently used variables can end up in different lines. This annotation is only expected to be used for variables read all the time, e.g. on each syscall entry. MFC after: 1 week Modified: head/sys/conf/ldscript.amd64 head/sys/sys/systm.h Modified: head/sys/conf/ldscript.amd64 ============================================================================== --- head/sys/conf/ldscript.amd64 Wed Sep 6 20:28:18 2017 (r323234) +++ head/sys/conf/ldscript.amd64 Wed Sep 6 20:32:49 2017 (r323235) @@ -146,6 +146,10 @@ SECTIONS . = DATA_SEGMENT_RELRO_END (24, .); .got.plt : { *(.got.plt) } . = ALIGN(64); + .data.read_frequently : + { + *(.data.read_frequently) + } .data.read_mostly : { *(.data.read_mostly) Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Wed Sep 6 20:28:18 2017 (r323234) +++ head/sys/sys/systm.h Wed Sep 6 20:32:49 2017 (r323235) @@ -138,6 +138,7 @@ void kassert_panic(const char *fmt, ...) __printflike * Align variables. */ #define __read_mostly __section(".data.read_mostly") +#define __read_frequently __section(".data.read_frequently") #define __exclusive_cache_line __aligned(CACHE_LINE_SIZE) \ __section(".data.exclusive_cache_line") /*