From owner-freebsd-questions@FreeBSD.ORG Wed Aug 5 13:21:16 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E2E41065672 for ; Wed, 5 Aug 2009 13:21:16 +0000 (UTC) (envelope-from Johan@double-l.nl) Received: from smtp-vbr7.xs4all.nl (smtp-vbr7.xs4all.nl [194.109.24.27]) by mx1.freebsd.org (Postfix) with ESMTP id 4CB608FC20 for ; Wed, 5 Aug 2009 13:21:16 +0000 (UTC) (envelope-from Johan@double-l.nl) Received: from w2003s01.double-l.local (double-l.xs4all.nl [80.126.205.144]) by smtp-vbr7.xs4all.nl (8.13.8/8.13.8) with ESMTP id n75DLEQR067060; Wed, 5 Aug 2009 15:21:15 +0200 (CEST) (envelope-from Johan@double-l.nl) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-MimeOLE: Produced By Microsoft Exchange V6.5 Date: Wed, 5 Aug 2009 15:21:14 +0200 Message-ID: <57200BF94E69E54880C9BB1AF714BBCB5DEACB@w2003s01.double-l.local> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Learning about Control of Optimization -- for dummies please Thread-Index: AcoVzYmqbLtCZAwBQEmlF0rZPsMaQQAAFcpw References: <200908051238.n75CcKC1006683@mp.cs.niu.edu> <200908051402.06130.david@vizion2000.net> From: "Johan Hendriks" To: "David Southwell" X-Virus-Scanned: by XS4ALL Virus Scanner Cc: freebsd-questions@freebsd.org Subject: RE: Learning about Control of Optimization -- for dummies please X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2009 13:21:17 -0000 >> On Wed, 5 Aug 2009 12:19:23 +0200 Roland Smith =20 wrote: >> >On Wed, Aug 05, 2009 at 10:54:07AM +0100, David Southwell wrote: >> >> I have found >> >> http://docs.freebsd.org/info/gcc/gcc.info.Optimize_Options.html. >> >> >> >> I am about to build a new kernel am starting to dig a bit deeper into >> >> things I have, until now, taken for granted. >> >> >> >> The above link is very informative in technical terms about how to >> >> control optimization but I find it difficult to interpret the info in a >> >> way that tells me what might work best on my own system (Intel quad >> >> Core) with 8G of ram. >> > >> >The build system takes care of that, once you have set the correct >> >CPUTYPE in /etc/make.conf. For a quad-core, set CPUTYPE=3Dnocona. = See >> >make.conf(5), /usr/src/share/mk/bsd.cpu.mk and >> >/usr/src/sys/conf/kern.pre.mk. >> >> As I read the man page for [g]cc, though, setting = -march=3Dnocona (which >> is where the CPUTYPE information ends up in the cc commands) tells the >> compiler which base instruction set to use and which model of instruction >> scheduling to use, but to get the rest of the model-dependent features >> used, he would still need to add "-mmmx -msse -msse2 -msse3" at a minimum >> for most other compilations, though these would not be advisable for kernel >> compilations. I don't recall whether SSE4 instructions are in the Nocona/ >> Merom/Kentfield chips or first appear in the Core i7 series. I don't think >> the compiler versions available under FreeBSD support the SSE4 >> instructions, though, so SSE4 doesn't matter anyway. >> >> >Additionally, compiler settings for building the kernel can be set with >> >COPTFLAGS in /etc/make.conf. Using anything other than -O or -O2 is >> >not guaranteed to work. If you don't know what you are doing, do not use >> >COPTFLAGS and stick with the defaults that the build system generates. >> >> Right. -O3 might royally screw a kernel in particular. :-) >> >> >> Scott Bennett, Comm. ASMELG, CFIAG >Thanks for add more useful info however would you mind elaborating a little=20 >more because I do not understand the implications. >should I have: >CPUTYPE=3Dnocona=20 >in make.conf? >Do I need anything else in make.conf? >So far my draft make.conf has these entries: >CPUTYPE=3Dnocona >CFLAGS=3D -O2 -fno-strict-aliasing -pipe >FORCE_MAKE_JOBS=3D true >Incidentally I am also puzzled because it appears necessary to use amd64=20 >GENERIC as my starting point when the cpu is actually Intel Quad Core!! >I presume this means that in drafting a kernconf I need to refer to; >dns1# pwd >/usr/src/sys/amd64/conf >dns1# ls -l >total 44 >-rw-r--r-- 1 root wheel 13 Jun 20 2005 .cvsignore >-rw-r--r-- 1 root wheel 482 Apr 15 04:14 DEFAULTS >-rw-r--r-- 1 root wheel 11968 Apr 15 04:14 GENERIC >-rw-r--r-- 1 root wheel 818 Apr 15 04:14 GENERIC.hints >-rw-r--r-- 1 root wheel 1036 Apr 15 04:14 MAC >-rw-r--r-- 1 root wheel 132 Apr 15 04:14 Makefile >-rw-r--r-- 1 root wheel 20721 Apr 15 04:14 NOTES >It would be great if some logical consistency could be introduced into naming=20 >conventions!!! It would really help those of us who know little and make it a=20 >trifle easier to climb the greasy pole of knowledge It is logical. You use i386 on old amd processors also. The naming amd64 comes from the fact that AMD did come first with the 64 bit processor. If Intel was the first it proberly would have a name like i386_64 or something like that. Nothing to worry about. If your Intel proccessor has 64 bit support use the AMD64 version It is just a name. About the make.conf the use of nocona is ok but put a ? mark ofter CPUTYPE Do not ask me why, people told me it is better, if i understand correctly It has someting to do about the choice the compiler has while building, it could override the nocona setting if it is needed. If i recall correct!!!! CPUTYPE?=3Dnocona I would ditch the CFLAGS, the normal setings ar the same as that line=20 FORCE_MAKE_JOBS=3D true FORCE_MAKE_JOBS is also ok =20 =20 No virus found in this outgoing message. Checked by AVG - www.avg.com=20 Version: 8.5.392 / Virus Database: 270.13.44/2282 - Release Date: 08/04/09 18:01:00