DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 22nd June 2009
komodo komodo is offline
New User
 
Join Date: Jun 2009
Posts: 2
Thanked 0 Times in 0 Posts
Default FreeBSD Kernel Optimization

Hi guys,

Quick question. I've been using FreeBSD for many years, and whenever I compile a custom kernel, I've always made a point of going through and commenting out any devices I'm not using, such as ethernet cards, scsi cards, raid cards, etc. I was attempting to optimize the kernel and take a little load off the server, however I don't know much about the low level and how FreeBSD handles these unused devices during bootup. I was thinking about this earlier... does FreeBSD actually take a (tiny) performance hit from leaving those uncommented, or are they simply ignored on bootup and I'm wasting time going through and commenting them all out?

Not critical either way, I'm just curious.

Thanks!
Reply With Quote
  #2   (View Single Post)  
Old 22nd June 2009
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Helpful companion
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Thanked 193 Times in 184 Posts
Default

In the OpenBSD world, such unnecessary "optimizations" leave the user with an unsupported kernel.

But as with all of the BSD projects, an unmodified kernel will not slow things down at all.. initial device discovery/probing is usually quite fast, all you could possibly gain is some negligible amount of free space.. a couple MB max shaved off of the final kernel binary.

FreeBSD makes use of loadable kernel modules, so presumably some drivers can be made separate.. I do not know much about this functionality.

Hope that helps.
Reply With Quote
  #3   (View Single Post)  
Old 22nd June 2009
phoenix's Avatar
phoenix phoenix is offline
Risen from the ashes
 
Join Date: May 2008
Posts: 699
Thanked 90 Times in 81 Posts
Default

It will save a bit of memory, to not have all those unused drivers loaded in the kernel. But, that's about it.
__________________
Freddie

Help for FreeBSD: Handbook, FAQ, man pages, mailing lists.
Reply With Quote
  #4   (View Single Post)  
Old 22nd June 2009
komodo komodo is offline
New User
 
Join Date: Jun 2009
Posts: 2
Thanked 0 Times in 0 Posts
Default

So just a few megs of ram wasted? No CPU cycles / boot time / etc?
Reply With Quote
  #5   (View Single Post)  
Old 22nd June 2009
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Helpful companion
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Thanked 193 Times in 184 Posts
Default

If no appropriate devices are detected, the driver won't "attach" to anything.

It'll still be loaded in memory, but it'll just be a code path that's never followed.. no extra CPU cycles wasted.

As I said, device probing takes a very insignificant amount of time.. but you can go ahead and time it if you want.

Have fun.
Reply With Quote
  #6   (View Single Post)  
Old 22nd June 2009
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Old man from scene 24
 
Join Date: Apr 2008
Location: Eindhoven, Netherlands
Posts: 2,051
Thanked 198 Times in 156 Posts
Default

The only real reason to compile a custom kernel is if you want to use options not dynamically loadable, most notably these are probably the most used are ALTQ for pf or SC_PIXEL_MODE.
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
FreeBSD 7 i386, PAE and kernel modules eztiger FreeBSD Installation and Upgrading 7 1st April 2009 06:07 PM
FreeBSD 7.1 kernel incompatible with a linux program map7 FreeBSD Installation and Upgrading 7 5th November 2008 11:17 PM
Compiling a blob-free FreeBSD 7.0 kernel Tsuroerusu FreeBSD General 5 12th September 2008 08:56 PM
FreeBSD 7.0 kernel building... daemonFromHeaven FreeBSD Installation and Upgrading 4 3rd September 2008 02:42 PM
Understanding the FreeBSD kernel TomAmundsen FreeBSD General 3 7th July 2008 02:48 PM


All times are GMT. The time now is 08:15 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick