From owner-freebsd-arch@FreeBSD.ORG Wed Apr 15 12:36:06 2009 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B33BB106564A for ; Wed, 15 Apr 2009 12:36:06 +0000 (UTC) (envelope-from freebsd-arch@m.gmane.org) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by mx1.freebsd.org (Postfix) with ESMTP id 2EED18FC18 for ; Wed, 15 Apr 2009 12:36:05 +0000 (UTC) (envelope-from freebsd-arch@m.gmane.org) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Lu4LS-0005ZC-9D for freebsd-arch@freebsd.org; Wed, 15 Apr 2009 12:36:02 +0000 Received: from lara.cc.fer.hr ([161.53.72.113]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 15 Apr 2009 12:36:02 +0000 Received: from ivoras by lara.cc.fer.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 15 Apr 2009 12:36:02 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-arch@freebsd.org From: Ivan Voras Date: Wed, 15 Apr 2009 14:35:42 +0200 Lines: 56 Message-ID: References: <200904140842.46501.zec@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig32A0C9624B0C38A8DC414FE1" X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: lara.cc.fer.hr User-Agent: Thunderbird 2.0.0.21 (X11/20090318) In-Reply-To: <200904140842.46501.zec@freebsd.org> X-Enigmail-Version: 0.95.0 Sender: news Subject: Re: Simple #define for cache line size X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2009 12:36:07 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig32A0C9624B0C38A8DC414FE1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Marko Zec wrote: > On Monday 13 April 2009 23:01:23 Ivan Voras wrote: >> Robert Watson wrote: >>> --- i386/include/param.h (revision 190941) >>> +++ i386/include/param.h (working copy) >>> @@ -74,6 +74,10 @@ >>> #define ALIGNBYTES _ALIGNBYTES >>> #define ALIGN(p) _ALIGN(p) >>> >>> +#ifndef CACHE_LINE_SIZE >>> +#define CACHE_LINE_SIZE 64 >>> +#endif >> Wouldn't it be better to continue the >> >> cpu I486_CPU >> cpu I586_CPU >> cpu I686_CPU >> >> series of defines in kernel configuration and define alignment per >> CPU architecture? >=20 > We would have to extend our notion of "CPU architecture" for that to=20 > make sense. For example, Pentium Pro / II CPUs had cache line size of = > 32 bytes, Intel Netburst CPUs (all Pentium-4 and Xeons of the time)=20 > have / had 128 bytes, while Pentium-III, Pentium-M and later Core CPUs = > have 64 bytes. They are all I686_CPU in our view. Yes, because it looks like we stopped tracking them after PPro/II - AFAIK they are the ones originally designated as i686. Runtime checks are more certain to be correct but will performance be the same (versus statically computed offsets)? Some code that should take note of cache line alignment is very performance sensitive. --------------enig32A0C9624B0C38A8DC414FE1 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFJ5dSoldnAQVacBcgRAoafAJsHyAci/UbvD1IhZsEjk6HHGpLMWACfa+tU cpBH+ABnKK5ZgA4HMk+2Pwc= =vzRJ -----END PGP SIGNATURE----- --------------enig32A0C9624B0C38A8DC414FE1--