Re: Optimizationn questions?
On Fri, Mar 16, 2007 at 02:19:25AM +0100, Danny Pansters wrote: On Friday 16 March 2007 01:04:51 Jeffrey Goldberg wrote: On Mar 15, 2007, at 5:21 PM, Jorn Argelo wrote: [EMAIL PROTECTED] wrote: On Thu, 15 Mar 2007, Danny Pansters wrote: I know that this has been discussed a few times before, but IMO running a slightly stripped down kernel (i.e. custom, not GENERIC) actually proves to be helpful in increasing boot times (if options were added statically) and compile times if [(# of options added) (# of options in GENERIC)]. I can confirm this too. I noticed on both desktop and servers the boot time can be decreased by stripping the kernel configuration of stuff you don't need. I don't have any hard facts to prove this but this is what my personal experience is. me, too. Of course it will speed up booting but then again how much time does one spend booting, compared to using the puter: not much (at least I hope so for them!) If I do build my own kernel, for example to switch schedulers, I tend to toss out a heap of devices that I don't have anyway. But other than a bit more memory usage (which compared to the software that's run will typically be minor anyhow unless you're talking embedded system or maybe not-so-embedded but still of low spec special purpose boxes, like a satellite receiver box) you're not going to have a slower system because your kernel happens to have some built-in drivers that it doesn't use. The exception is a debug kernel of course that will impact performance because it increases runtime tasks/load. On a server I'd strip down the kernel, but for other reasons (avoiding any unneeded complexity). On a desktop I don't care as long as thingie works. YMMV of course. I think what he was saying is that if you already need to build a kernel for some other reason, then go ahead and strip out the unused stuff. But, if you don't have any other reason to do it, it is not worth the bother to build another kernel just to strip it of unused stuff - that it won't make THAT much difference. I'd agree with that. jerry Dan ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED] ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Optimizationn questions?
On Thu, Mar 15, 2007 at 11:21:33PM +0100, Jorn Argelo wrote: [EMAIL PROTECTED] wrote: On Thu, 15 Mar 2007, Danny Pansters wrote: Dan, I know that this has been discussed a few times before, but IMO running a slightly stripped down kernel (i.e. custom, not GENERIC) actually proves to be helpful in increasing boot times (if options were added statically) and compile times if [(# of options added) (# of options in GENERIC)]. I can confirm this too. I noticed on both desktop and servers the boot time can be decreased by stripping the kernel configuration of stuff you don't need. I don't have any hard facts to prove this but this is what my personal experience is. Jorn Dan, Jorn, Thanks for another tip to squeeze the last picosecond out of my elderly box! (I just began re-building gcc-43 after its 12mar07 update; it may be better at loop-unrolling than gcc-3.x. Every jot helps;) gary -- Gary Kline [EMAIL PROTECTED] www.thought.org Public Service Unix ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Optimizationn questions?
On Mar 16, 2007, at 10:00 AM, Jerry McAllister wrote: On Fri, Mar 16, 2007 at 02:19:25AM +0100, Danny Pansters wrote: On Friday 16 March 2007 01:04:51 Jeffrey Goldberg wrote: me, too. Of course it will speed up booting but then again how much time does one spend booting, compared to using the puter: not much (at least I hope so for them!) Ah but some of us boot frequently. We have to after each kernel rebuild. If I do build my own kernel, for example to switch schedulers, I tend to toss out a heap of devices that I don't have anyway. But other than a bit more memory usage (which compared to the software that's run will typically be minor anyhow unless you're talking embedded system or maybe not-so- embedded but still of low spec special purpose boxes, like a satellite receiver box) you're not going to have a slower system because your kernel happens to have some built-in drivers that it doesn't use. The exception is a debug kernel of course that will impact performance because it increases runtime tasks/load. On a server I'd strip down the kernel, but for other reasons (avoiding any unneeded complexity). On a desktop I don't care as long as thingie works. YMMV of course. I think what he was saying is that if you already need to build a kernel for some other reason, then go ahead and strip out the unused stuff. But, if you don't have any other reason to do it, it is not worth the bother to build another kernel just to strip it of unused stuff - that it won't make THAT much difference. I'd agree with that. me, too. I've got some linux workstations for which I've never felt the need to compile my own kernel. But my FreeBSD box is a headless ITX-mini board that will run as a public server. Because there was so much of GENERIC that I could discard for my box, it seemed to make sense. But I suppose the single most important factor in my decision to compile my own kernel is Building a custom kernel is one of the most important rites of passage nearly every BSD user must endure. From: http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ kernelconfig-custom-kernel.html Also I have m0n0wall running on a Soekris box, and someday I may want to customize that, so this is a good learning experience. It's really -j -- Jeffrey Goldberghttp://www.goldmark.org/jeff/ ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Optimizationn questions?
On Wed, Mar 14, 2007 at 08:19:49PM -0700, [EMAIL PROTECTED] wrote: On Thu, 15 Mar 2007, Danny Pansters wrote: On Thursday 15 March 2007 02:16, Gary Kline wrote: Two quick one for kernel and/or compiler wizards: first, is a 400Mz processor considered a 586 (for my KERNELCONF file)? Think its 686 (but really, leaving 486 and 586 in isn't going to slow down booting or anything!) I always say: Use GENERIC unless you have a good reason not to. Second, is it safe to do a buildworld with -O3? If there are No. It's not supported if things break. stability concerns, I'll go with the default when I rebuild my 6.2 systems. The defaults should be fine. Also, like I said consider just using GENERIC and load the odd kmod if needed. Generally it's less headache and equal performance. thanks in advance, gary Cheers, Dan As Dan and Gary said -O3 isn't supported, and in many cases that level of optimization gets filtered out while compiling sections of FreeBSD. Besides, I've compiled stuff with -O3 and various optimizations in Gentoo Linux before, and let me say that it caused a great deal of headaches... that's why I stick with -O2 now, because it's better to have something in executable shape and a bit slower (arguably because some optimizations slow things down) than it is to have something run fast and break all the time. Some food for thought :). --Food for thought and a chuckle too! (not to mention that it's waaay early, the chickens are still snoring, and I've only had *one* cup of joe)... I've done some investigation with optimizing my own code, usually 1000 lines, and haven't seen much gain between -O2 and -O3. Loop-unrolling may be different; one trick that compiler hackers at supercomputer companies use by default in to unroll small loops. Cray is one example. S, to get any real gain is going to mean going thru the most freq used tools (*grep, find, ls) and hand-tweak. Might buy 5 - 7%. have a good one, gary -Garrett ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED] -- Gary Kline [EMAIL PROTECTED] www.thought.org Public Service Unix ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Optimizationn questions?
[EMAIL PROTECTED] wrote: On Thu, 15 Mar 2007, Danny Pansters wrote: On Thursday 15 March 2007 02:16, Gary Kline wrote: Two quick one for kernel and/or compiler wizards: first, is a 400Mz processor considered a 586 (for my KERNELCONF file)? Think its 686 (but really, leaving 486 and 586 in isn't going to slow down booting or anything!) I always say: Use GENERIC unless you have a good reason not to. Second, is it safe to do a buildworld with -O3? If there are No. It's not supported if things break. stability concerns, I'll go with the default when I rebuild my 6.2 systems. The defaults should be fine. Also, like I said consider just using GENERIC and load the odd kmod if needed. Generally it's less headache and equal performance. thanks in advance, gary Cheers, Dan Dan, I know that this has been discussed a few times before, but IMO running a slightly stripped down kernel (i.e. custom, not GENERIC) actually proves to be helpful in increasing boot times (if options were added statically) and compile times if [(# of options added) (# of options in GENERIC)]. I can confirm this too. I noticed on both desktop and servers the boot time can be decreased by stripping the kernel configuration of stuff you don't need. I don't have any hard facts to prove this but this is what my personal experience is. Jorn I like being able to compile my kernel on my P4 in less than 10 minutes anyhow with less options :). The only thing that was brought up earlier (sometime later last year in a thread--I think either Oct or Nov) is that removing options removes flexibility as well. But that's a tradeoff you have to make. -Garrett ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED] ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Optimizationn questions?
On Mar 15, 2007, at 5:21 PM, Jorn Argelo wrote: [EMAIL PROTECTED] wrote: On Thu, 15 Mar 2007, Danny Pansters wrote: I know that this has been discussed a few times before, but IMO running a slightly stripped down kernel (i.e. custom, not GENERIC) actually proves to be helpful in increasing boot times (if options were added statically) and compile times if [(# of options added) (# of options in GENERIC)]. I can confirm this too. I noticed on both desktop and servers the boot time can be decreased by stripping the kernel configuration of stuff you don't need. I don't have any hard facts to prove this but this is what my personal experience is. me, too. -j ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Optimizationn questions?
On Friday 16 March 2007 01:04:51 Jeffrey Goldberg wrote: On Mar 15, 2007, at 5:21 PM, Jorn Argelo wrote: [EMAIL PROTECTED] wrote: On Thu, 15 Mar 2007, Danny Pansters wrote: I know that this has been discussed a few times before, but IMO running a slightly stripped down kernel (i.e. custom, not GENERIC) actually proves to be helpful in increasing boot times (if options were added statically) and compile times if [(# of options added) (# of options in GENERIC)]. I can confirm this too. I noticed on both desktop and servers the boot time can be decreased by stripping the kernel configuration of stuff you don't need. I don't have any hard facts to prove this but this is what my personal experience is. me, too. Of course it will speed up booting but then again how much time does one spend booting, compared to using the puter: not much (at least I hope so for them!) If I do build my own kernel, for example to switch schedulers, I tend to toss out a heap of devices that I don't have anyway. But other than a bit more memory usage (which compared to the software that's run will typically be minor anyhow unless you're talking embedded system or maybe not-so-embedded but still of low spec special purpose boxes, like a satellite receiver box) you're not going to have a slower system because your kernel happens to have some built-in drivers that it doesn't use. The exception is a debug kernel of course that will impact performance because it increases runtime tasks/load. On a server I'd strip down the kernel, but for other reasons (avoiding any unneeded complexity). On a desktop I don't care as long as thingie works. YMMV of course. Dan ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Optimizationn questions?
Gary Kline wrote: On Wed, Mar 14, 2007 at 08:19:49PM -0700, [EMAIL PROTECTED] wrote: On Thu, 15 Mar 2007, Danny Pansters wrote: On Thursday 15 March 2007 02:16, Gary Kline wrote: Two quick one for kernel and/or compiler wizards: first, is a 400Mz processor considered a 586 (for my KERNELCONF file)? Think its 686 (but really, leaving 486 and 586 in isn't going to slow down booting or anything!) I always say: Use GENERIC unless you have a good reason not to. Second, is it safe to do a buildworld with -O3? If there are No. It's not supported if things break. stability concerns, I'll go with the default when I rebuild my 6.2 systems. The defaults should be fine. Also, like I said consider just using GENERIC and load the odd kmod if needed. Generally it's less headache and equal performance. thanks in advance, gary Cheers, Dan As Dan and Gary said -O3 isn't supported, and in many cases that level of optimization gets filtered out while compiling sections of FreeBSD. Besides, I've compiled stuff with -O3 and various optimizations in Gentoo Linux before, and let me say that it caused a great deal of headaches... that's why I stick with -O2 now, because it's better to have something in executable shape and a bit slower (arguably because some optimizations slow things down) than it is to have something run fast and break all the time. Some food for thought :). --Food for thought and a chuckle too! (not to mention that it's waaay early, the chickens are still snoring, and I've only had *one* cup of joe)... I've done some investigation with optimizing my own code, usually 1000 lines, and haven't seen much gain between -O2 and -O3. Loop-unrolling may be different; one trick that compiler hackers at supercomputer companies use by default in to unroll small loops. Cray is one example. S, to get any real gain is going to mean going thru the most freq used tools (*grep, find, ls) and hand-tweak. Might buy 5 - 7%. have a good one, gary -Garrett No problem. -funroll-loops might not buy you too much other than a few less instructions overall but I'm not sure how intelligent gcc is at unrolling loops. It seemed like there was a difference between optimizations in the 4.x branch compared to the 3.4.x sub branch. They made a lot of improvements in the 4.x branch though.. it's just that some of those improvements broke code, so that's probably why FreeBSD doesn't have gcc-4.x in the base system. Cheers :). -Garrett ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Optimizationn questions?
On Thu, Mar 15, 2007 at 08:25:43PM -0700, Garrett Cooper wrote: Gary Kline wrote: On Wed, Mar 14, 2007 at 08:19:49PM -0700, [EMAIL PROTECTED] wrote: On Thu, 15 Mar 2007, Danny Pansters wrote: No problem. -funroll-loops might not buy you too much other than a few less instructions overall but I'm not sure how intelligent gcc is at unrolling loops. It seemed like there was a difference between optimizations in the 4.x branch compared to the 3.4.x sub branch. They made a lot of improvements in the 4.x branch though.. it's just that some of those improvements broke code, so that's probably why FreeBSD doesn't have gcc-4.x in the base system. Until one of my hardware buddes can swap memory from an unsed Kayak into my new (koff-koff) one, I have to be careful about the added bytes that loop unrolling costs. It's ballpark 10% with the default gcc. I'm building the 4.x stuff now with no ++CFLAGS. The compiler guys know their stuff. If any good and surprising news happens, I'll post it. Unix: get every last billionth-of-a-penny's worth out of your hardware. ah, life! gary Cheers :). -Garrett ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED] -- Gary Kline [EMAIL PROTECTED] www.thought.org Public Service Unix ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Optimizationn questions?
Two quick one for kernel and/or compiler wizards: first, is a 400Mz processor considered a 586 (for my KERNELCONF file)? Second, is it safe to do a buildworld with -O3? If there are stability concerns, I'll go with the default when I rebuild my 6.2 systems. thanks in advance, gary -- Gary Kline [EMAIL PROTECTED] www.thought.org Public Service Unix ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Optimizationn questions?
On Thu, March 15, 2007 02:16, Gary Kline wrote: Two quick one for kernel and/or compiler wizards: first, is a 400Mz processor considered a 586 (for my KERNELCONF file)? To check: dmesg | grep CPU Two examples (first one is a i686 and second one a i586) CPU: Intel Celeron (902.05-MHz 686-class CPU) CPU: AMD-K6(tm) 3D processor (300.68-MHz 586-class CPU) Second, is it safe to do a buildworld with -O3? If there are stability concerns, I'll go with the default when I rebuild my 6.2 systems. from /usr/share/examples/etc/make.conf : # CFLAGS controls the compiler settings used when compiling C code. # Note that optimization settings other than -O and -O2 are not recommended # or supported for compiling the world or the kernel - please revert any # nonstandard optimization settings to -O or -O2 before submitting bug # reports without patches to the developers. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Optimizationn questions?
Gary Kline wrote: Two quick one for kernel and/or compiler wizards: first, is a 400Mz processor considered a 586 (for my KERNELCONF file)? That depends on processor architecture rather than clock frequency. Have a look at dmesg output - for example, Intel Celeron 400Mhz is a 686 class processor (I686_CPU in the kernel configuration file): % dmesg % [...] % CPU: Pentium II/Pentium II Xeon/Celeron (400.91-MHz 686-class CPU) % [...] Second, is it safe to do a buildworld with -O3? If there are stability concerns, I'll go with the default when I rebuild my 6.2 systems. If you're going to do stability/performance/compatibility tests go ahead. In any other situation just stick with the defaults, which on 6.2-RELEASE for my Celeron are: # (cd /usr/src make -V CFLAGS ) -O2 -fno-strict-aliasing -pipe -march=pentiumpro Note that '-march=pentiumpro' comes from setting 'CPUTYPE=i686' in /etc/make.conf (examples in /usr/share/examples/etc/make.conf). HTH, Karol -- Karol Kwiatkowski karol.kwiat at gmail dot com OpenPGP 0x06E09309 signature.asc Description: OpenPGP digital signature
Re: Optimizationn questions?
On Thursday 15 March 2007 02:16, Gary Kline wrote: Two quick one for kernel and/or compiler wizards: first, is a 400Mz processor considered a 586 (for my KERNELCONF file)? Think its 686 (but really, leaving 486 and 586 in isn't going to slow down booting or anything!) I always say: Use GENERIC unless you have a good reason not to. Second, is it safe to do a buildworld with -O3? If there are No. It's not supported if things break. stability concerns, I'll go with the default when I rebuild my 6.2 systems. The defaults should be fine. Also, like I said consider just using GENERIC and load the odd kmod if needed. Generally it's less headache and equal performance. thanks in advance, gary Cheers, Dan ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Optimizationn questions?
On Thu, 15 Mar 2007, Danny Pansters wrote: On Thursday 15 March 2007 02:16, Gary Kline wrote: Two quick one for kernel and/or compiler wizards: first, is a 400Mz processor considered a 586 (for my KERNELCONF file)? Think its 686 (but really, leaving 486 and 586 in isn't going to slow down booting or anything!) I always say: Use GENERIC unless you have a good reason not to. Second, is it safe to do a buildworld with -O3? If there are No. It's not supported if things break. stability concerns, I'll go with the default when I rebuild my 6.2 systems. The defaults should be fine. Also, like I said consider just using GENERIC and load the odd kmod if needed. Generally it's less headache and equal performance. thanks in advance, gary Cheers, Dan As Dan and Gary said -O3 isn't supported, and in many cases that level of optimization gets filtered out while compiling sections of FreeBSD. Besides, I've compiled stuff with -O3 and various optimizations in Gentoo Linux before, and let me say that it caused a great deal of headaches... that's why I stick with -O2 now, because it's better to have something in executable shape and a bit slower (arguably because some optimizations slow things down) than it is to have something run fast and break all the time. Some food for thought :). -Garrett ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Optimizationn questions?
On Thu, 15 Mar 2007, Danny Pansters wrote: On Thursday 15 March 2007 02:16, Gary Kline wrote: Two quick one for kernel and/or compiler wizards: first, is a 400Mz processor considered a 586 (for my KERNELCONF file)? Think its 686 (but really, leaving 486 and 586 in isn't going to slow down booting or anything!) I always say: Use GENERIC unless you have a good reason not to. Second, is it safe to do a buildworld with -O3? If there are No. It's not supported if things break. stability concerns, I'll go with the default when I rebuild my 6.2 systems. The defaults should be fine. Also, like I said consider just using GENERIC and load the odd kmod if needed. Generally it's less headache and equal performance. thanks in advance, gary Cheers, Dan Dan, I know that this has been discussed a few times before, but IMO running a slightly stripped down kernel (i.e. custom, not GENERIC) actually proves to be helpful in increasing boot times (if options were added statically) and compile times if [(# of options added) (# of options in GENERIC)]. I like being able to compile my kernel on my P4 in less than 10 minutes anyhow with less options :). The only thing that was brought up earlier (sometime later last year in a thread--I think either Oct or Nov) is that removing options removes flexibility as well. But that's a tradeoff you have to make. -Garrett ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Optimizationn questions?
On Thu, Mar 15, 2007 at 02:47:42AM +0100, Karol Kwiatkowski wrote: Gary Kline wrote: Two quick one for kernel and/or compiler wizards: first, is a 400Mz processor considered a 586 (for my KERNELCONF file)? That depends on processor architecture rather than clock frequency. Have a look at dmesg output - for example, Intel Celeron 400Mhz is a 686 class processor (I686_CPU in the kernel configuration file): % dmesg % [...] % CPU: Pentium II/Pentium II Xeon/Celeron (400.91-MHz 686-class CPU) % [...] Dunno anything about the Xeon, but the Kayak is nuilt like a tank and has got to be == a 686 also. I'll check my dmesg too. --Until very recently, I've gone wit the default (i386??); like: how much faster is gcc tweaking going to be? I guess I'll find out! Second, is it safe to do a buildworld with -O3? If there are stability concerns, I'll go with the default when I rebuild my 6.2 systems. If you're going to do stability/performance/compatibility tests go ahead. In any other situation just stick with the defaults, which on 6.2-RELEASE for my Celeron are: # (cd /usr/src make -V CFLAGS ) -O2 -fno-strict-aliasing -pipe -march=pentiumpro Note that '-march=pentiumpro' comes from setting 'CPUTYPE=i686' in /etc/make.conf (examples in /usr/share/examples/etc/make.conf). Martin Tournoij pointed out what (fine-print) I didn't see [never read/very seldom read] that the world and kernel should be left at O, O2 or their default. I signal to gcc to unroll loops and know that the compiler writers are going to use their learned and practical wisdom regarding loop unrolling... . HTH, It has and thanks much. Gotta rebuild, but no big deal! gary Karol -- Karol Kwiatkowski karol.kwiat at gmail dot com OpenPGP 0x06E09309 -- Gary Kline [EMAIL PROTECTED] www.thought.org Public Service Unix ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]