From owner-freebsd-hackers@FreeBSD.ORG Mon Dec 5 18:05:05 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FBFC106564A for ; Mon, 5 Dec 2011 18:05:05 +0000 (UTC) (envelope-from max@mxcrypt.com) Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id C79D38FC15 for ; Mon, 5 Dec 2011 18:05:04 +0000 (UTC) Received: by qcse13 with SMTP id e13so2354619qcs.13 for ; Mon, 05 Dec 2011 10:05:04 -0800 (PST) Received: by 10.229.95.205 with SMTP id e13mr30303qcn.2.1323106461490; Mon, 05 Dec 2011 09:34:21 -0800 (PST) MIME-Version: 1.0 Received: by 10.229.216.15 with HTTP; Mon, 5 Dec 2011 09:33:50 -0800 (PST) In-Reply-To: References: <20111205.171654.020.1@DOMY-PC> From: Maxim Khitrov Date: Mon, 5 Dec 2011 12:33:50 -0500 Message-ID: To: Garrett Cooper Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: rank1seeker@gmail.com, hackers@freebsd.org Subject: Re: CPUTYPE and friends, from 'make.conf' benchmark X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Dec 2011 18:05:05 -0000 On Mon, Dec 5, 2011 at 12:19 PM, Garrett Cooper wrote: > 2011/12/5 =C2=A0: >> I've took machine and installed binary FreeBSD(amd64 8.2-p4 GENERIC) on = it. >> Then I've installed 'benchmarks/unixbench' port. >> >> So everything is a default generic binary install ('make.conf' empty - n= o CPU optimization flags) >> >> After running: '# time unixbench', final score was: >> =C2=A0 =C2=A0394.2 >> Completed in 22.8 min >> >> >> Then I've recompiled everything, from src, world and kernel, with 'make.= conf': >> -- >> CPUTYPE?=3Dcore2 >> CFLAGS+=3D-march=3Dnative >> NO_CPU_CFLAGS=3Dyes >> COPTFLAGS+=3D-march=3Dnative >> NO_CPU_COPTFLAGS=3Dyes >> -- >> >> After reboot, I've run: '# time unixbench', final score was: >> =C2=A0 =C2=A0313.5 >> Completed in 26.7 min >> >> I'm getting worse result, with optimized FreeBSD's binaries?!? >> How come? > > Seems like -march=3Dnative is redundant. > -Garrett Not only is it redundant, but it might be undoing to effects of CPUTYPE. Run the following command, it tells you what gcc ends up optimizing for when you use -march=3Dnative: /bin/sh -c "gcc -v -x c -E -mtune=3Dnative /dev/null -o /dev/null 2>&1 | grep mtune | sed -e 's/.*mtune=3D//'" On most of my machines, native is the same as generic. Rerun your test with just 'CPUTYPE?=3Dcore2' line in make.conf and see what the results are. Usually, there is no need to specify any other options. Also, in 8.2 'core2' seems to be an alias for 'prescott'. You have to use FreeBSD 9.0 for core2 to be available in gcc. - Max