From owner-svn-src-all@FreeBSD.ORG Mon Apr 20 18:23:42 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DCB1C106566B; Mon, 20 Apr 2009 18:23:42 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from mail.icecube.wisc.edu (trout.icecube.wisc.edu [128.104.255.119]) by mx1.freebsd.org (Postfix) with ESMTP id AC32C8FC08; Mon, 20 Apr 2009 18:23:42 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.icecube.wisc.edu (Postfix) with ESMTP id C3A46581DC; Mon, 20 Apr 2009 13:03:41 -0500 (CDT) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from mail.icecube.wisc.edu ([127.0.0.1]) by localhost (trout.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id ZGQtcNkT1PuV; Mon, 20 Apr 2009 13:03:41 -0500 (CDT) Received: from wanderer.tachypleus.net (i3-dhcp-172-16-55-200.icecube.wisc.edu [172.16.55.200]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 9E73D581C0; Mon, 20 Apr 2009 13:03:41 -0500 (CDT) Message-ID: <49ECB8FD.1050901@freebsd.org> Date: Mon, 20 Apr 2009 13:03:41 -0500 From: Nathan Whitehorn User-Agent: Thunderbird 2.0.0.21 (X11/20090410) MIME-Version: 1.0 To: Robert Watson References: <200904192019.n3JKJDa6019179@svn.freebsd.org> <20090420174802.F58065@delplex.bde.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Evans Subject: Re: svn commit: r191276 - in head/sys: amd64/include arm/include i386/include ia64/include mips/include powerpc/include sparc64/include sun4v/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Mon, 20 Apr 2009 18:23:43 -0000 Robert Watson wrote: > > On Mon, 20 Apr 2009, Bruce Evans wrote: > >>> +#ifndef CACHE_LINE_SHIFT >>> +#define CACHE_LINE_SHIFT 6 >>> +#endif >>> +#define CACHE_LINE_SIZE (1 << CACHE_LINE_SHIFT) >> >> This still has the bogus ifdef. Overriding the definition is >> difficult to do consistently even in a kernel with no modules, since >> CACHE_LINE_SIZE is not a kernel option. Overriding the definition >> makes negative sense since the value is a maximum-maximum (possibly >> larger than strictly needed) so that it can be constant. > > OK, I've made this change. My hope is that most applications don't > resort to including sys/param.h and using CACHE_LINE_SIZE -- most will > be able to query it at run-time using interfaces we don't yet have > (such as sysconf(3) and some appropriate constant). I also hope that > most kernel consumers will be able to use a run-time tuned version > (which we also don't yet have). On PowerPC, we currently define a kernel global cacheline_size (md_var.h) and a sysctl machdep.cacheline_size with this information. This is currently used in various places in the kernel and in the userland RTLD for properly synchronizing the instruction cache. -Nathan