NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: How to compile kernel for i686 instead of i386?



On Thu, Oct 25, 2012 at 09:45:31PM +0200, Martin Husemann wrote:
> On Thu, Oct 25, 2012 at 10:44:05PM +0530, Mayuresh wrote:
> > Does the MACHINE variable affect only compiler options or anything else?
> 
> Nothing at all, it is just the name of the port. You can ignore it for
> optimization purposes.
> 
> Check pkgsrc/devel/cpuflags and add some COPTS+= -f... to your /etc/mk.conf,
> and something like:
> 
> makeoptions   COPTS="-O3 -march=... -mtune=..."

Actually adding these to /etc/mk.conf applied them to kernel as well. So I
did no try makeoptions.


1. Regarding -Os:

-Os (Tried O3, O2, O in that order) gave me a kernel that wasn't bootable.
(O3 didn't compile to be precise.) So removed -Os altogether.

Shouldn't it be expected that a kernel be compilable with -O3 like
options?


2. Regarding machine specific options:

cpuflags showed me "-mfpmath=sse -msse3 -march=native
".

Of these sse and native weren't supported by the compiler (the default one
that came with 6.0 RC1).

I tried "-march=core2" as it came closest to my architecture. Strangely
this was not mentioned in the man page, though it worked.

I used boot up time as test, where kernel plays major role, although the
booting time will be a function of a number of other factors.

On 2GHz Core2 Duo intel pocessor, the boot time remained in the range of
23 to 24s no matter which tuning options I chose.

Fine tuning (removing) of kernel options brought the time down from 27s
(of stock kernel) to the above range (i.e. kernel tuning made at least a
small difference, though compiler options made none.).

Tests were done with all services disabled.


I have an arch Linux installation which boots in <10s and am wondering
what will it take to bring NetBSD boot time any closer to that.

Mayuresh.


Home | Main Index | Thread Index | Old Index