From owner-freebsd-questions@FreeBSD.ORG Sun Jan 31 15:21:41 2010 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 32A7A1065672 for ; Sun, 31 Jan 2010 15:21:41 +0000 (UTC) (envelope-from bf1783@googlemail.com) Received: from mail-ew0-f211.google.com (mail-ew0-f211.google.com [209.85.219.211]) by mx1.freebsd.org (Postfix) with ESMTP id A766A8FC12 for ; Sun, 31 Jan 2010 15:21:40 +0000 (UTC) Received: by ewy3 with SMTP id 3so39233ewy.33 for ; Sun, 31 Jan 2010 07:21:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:cc:content-type; bh=GVn5ZQtZs+VU1DxUeSQXsix4AeRGM9iCuNATN3yD+ls=; b=o73k8A0f/Cqj89Nn8PZPZaHFAKBUoTX8ya5ftNUtT6t8NN3D15kifif6v+BpJf3jv7 5HQl+IGOgps3EB1U2ZqBE6jwa6DUKqx5lwJDs1OV8t+mlkZPApcxGvX4+TpX+U5V3pzI oy3Lap28dmzC6G3mmvd8FYAk6UOFSyGEsAHWI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; b=JL7dss1EohtzAKE1NqYOEsRf3b7DYATX/6EEfEd+56XmIuAOT9JOhnTyg8SBNSxCRn bkG0cX3M/mhJkCJUe/59dyUtaadHZmANFxENM1DIZ/dFEnJYXmHhiGVfgE8l1/qs6XhA FhsfNNT7d6aiaAOCiFM6G8D4msOh+UucchDzM= MIME-Version: 1.0 Received: by 10.216.86.203 with SMTP id w53mr2072045wee.58.1264951296819; Sun, 31 Jan 2010 07:21:36 -0800 (PST) Date: Sun, 31 Jan 2010 10:21:36 -0500 Message-ID: From: "b. f." To: freebsd-questions@FreeBSD.org Content-Type: text/plain; charset=ISO-8859-1 Cc: Nerius Landys Subject: Re: Nehelem & 64 bit, kern conf and /etc/make.conf 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: Sun, 31 Jan 2010 15:21:41 -0000 >I just installed FreeBSD 8.0 (amd64) onto my new Nehalem-based system. > >CPU: Intel(R) Xeon(R) CPU L5506 @ 2.13GHz (2128.00-MHz K8-class CPU) > Origin = "GenuineIntel" Id = 0x106a5 Stepping = 5 > >Features=0xbfebfbffA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE> > >Features2=0x9ce3bd > AMD Features=0x28100800 > AMD Features2=0x1 > TSC: P-state invariant > > >I am now in the process of configuring the kernel config file. > >A few questions; > >1. Is the kernel config file I want to modify >/usr/src/sys/amd64/conf/GENERIC ? (Copy that file as /root/PORKY, and >set up a symlink from /usr/src/sys/amd64/conf to /root/PORKY.) You don't have to do this: you could just use GENERIC. But if you want to build a custom kernel, and you are not familiar with all of the kernel options, GENERIC is a good starting point. > >2. What should I set this line to: >cpu HAMMER >Right now it's "HAMMER", I have no idea what Hammer is. What would be >the best thing to set it to? I want to be as specific as possible for >my CPU type. Leave this alone. If you change it, you will break your kernel. It's not meant to be customized: it's just a name that was chosen because it happened to be AMD's prototype 64-bit CPU at the time the amd64 port was being written. > >3. The instructions here: >http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html >mention a line like this: >machine i386 >(which would probably by "amd64" in my case), but the "machine" line >is missing entirely from GENERIC conf file. Should I add it? No, leave it alone. The documentation is outdated; this option is now set in DEFAULTS, which is a small list of very important stuff that every kernel of a certain architecture must contain in order to function properly. It is not meant to be customizable. > >4. In /etc/make.conf, I'm used to having, for example: >CPUTYPE?=core2 >What would be my CPU in this case (Xeon L5506)? I know this line is >not necessary, but I'd like to set it to the most specific kind of CPU >possible for my case to gain any optimizations, so long as it does not >make my system unstable. This option is only used to set the flags for the C and C++ compilers. The base system compiler for FreeBSD 7-9 is a patched version of gcc 4.2, and is hooked up to a patched version of binutils 2.15. This compiler suite and tool-chain are not new enough to take full advantage of your CPU: the best you can do is set it to auto-detect your CPU, or hard-code it to the most modern compatible CPU that existed when the compiler suite and tool-chain were written. However, some people have started to use newer compilers and tool-chains from FreeBSD Ports (some ports even require it), and if you do that, you may need a different value. Probably, your best bet is to use: CPUTYPE?= native and to check to make sure that the base system compiler is actually equating this with 'nocona', and enabling all of your SIMD extensions that it supports. This won't make a great deal of difference for kernel performance, but it will affect other base system programs and ports if you are using CFLAGS with -march or other optimization flags. b.