LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-06-2010, 09:06 PM   #1
vik
Member
 
Registered: Apr 2008
Distribution: Gentoo, FreeBSD
Posts: 225
Blog Entries: 8

Rep: Reputation: 50
some general kernel questions...


I've seen some posts on here with people running stripped-down kernels, so I thought I'd ask a few questions:

1) I want to compile in (to the kernel) the modules my computer is currently using to optimize performance, as well as get rid of the initrd. I can view the list of all the modules I'm using with lsmod, but how do I find them all in the kernel configuration menu? Do I just look them up in my .config and set them =y, or is there a better way?

2) If I only compile in the modules my computer is currently using and don't compile any other modules, how would I deal with USB devices? Is there a configuration option to support all USB devices so I don't have to recompile the kernel every time I plugin a new USB device? Or are all USB devices covered by compiling in the EHCI and OHCI drivers? Is firewire the same?

3) AMD Phenom 2 x4 940: is this just k8 on the processor family menu? It seems like there should be a k10 option, but I didn't see it anywhere.

Thanks for your help.
 
Old 03-06-2010, 09:14 PM   #2
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
1. You could do that, though I have always just walked through and enabled them in the menus. Your machine probably isn't actually using more than say a dozen modules, the rest are either loaded through various services or "just in case". It really doesn't take much time to work your way through what you do and do not need.

2. There is no blanket module for all USB devices, each one individually (with the exception of standardized devices like mass storage) has it's own module. You would need to enable any of those on top of the core USB support. You could enable them all as loadable modules and simply leave them unloaded until you need them, but a little logic goes a long way here. How many types of USB devices do you really think you will be plugging in? The kernel has support for everything from LEGO bricks to a USB vibrator, you certainly aren't going to be using them all (unless you are planning one hell of a party). Just enabling the things you are likely to use should be enough, and in the unlikely event you need something else you only need to build the module real quick and load it up, you wouldn't need to replace the kernel or even reboot.

Not sure about 3 though, don't have any (modern) AMD hardware.
 
Old 03-06-2010, 09:34 PM   #3
vik
Member
 
Registered: Apr 2008
Distribution: Gentoo, FreeBSD
Posts: 225

Original Poster
Blog Entries: 8

Rep: Reputation: 50
Thanks for your response.

1. Can you give me a good link on doing that? I've been looking through this: http://www.gentoo.org/doc/en/kernel-config.xml, but they don't cover everything. If I post my lsmod output could you tell me which modules I'm actually using?

2. Crazy that they have a USB vibrator driver! Anyway, I'll probably be using various iPods, a Logitech Harmony remote (I don't know if they've integrated the driver into the kernel yet), a Microsoft USB transceiver, and various thumb drives. I guess I have some research to do...

Maybe a better way to do this would be to compile in the modules from 1, but use Pat's generic config file so I create modules for any other possible device I could use. Would this degrade the performance much? At least I wouldn't be using an initrd.
 
Old 03-06-2010, 09:43 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Quote:
Originally Posted by vik View Post
1) I want to compile in (to the kernel) the modules my computer is currently using to optimize performance, as well as get rid of the initrd.
Optimize performance ?. Hmmmm - dunno about that. There are other options that will affect performance, but merely removing modules ain't likely to.
Getting rid of the initrd is o.k., but my major beef with standard distro builds is the recompile time for all those modules.

There are scripts around that find the applicable option for all your currently loaded modules. I've always just gone through the menu - I always find something else I want to turn on and test; hacking or group scheduler or auditing or something ...

Last edited by syg00; 03-06-2010 at 09:44 PM.
 
Old 03-06-2010, 09:50 PM   #5
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,467

Rep: Reputation: Disabled
Quote:
Originally Posted by vik View Post
Do I just look them up in my .config and set them =y, or is there a better way?
You would be better off using 'make menuconfig' and selecting that way. Sometimes enabling an option will also autoenable another and editing .config by hand probably won't pick that up (afaik).
 
Old 03-06-2010, 09:51 PM   #6
vik
Member
 
Registered: Apr 2008
Distribution: Gentoo, FreeBSD
Posts: 225

Original Poster
Blog Entries: 8

Rep: Reputation: 50
@syg00: My presumption is not loading any modules (at all) is faster. Do you have a link for that script to find all currently loaded modules? That would be nice.

I found this: http://andreas.goelzer.de/kernel-con...n-lsmod-output. This one doesn't do lsusb stuff though and it looks like it's for an older kernel.

@dive: You're right, but I don't know where all of the drivers are located in the kernel config menu.

Last edited by vik; 03-06-2010 at 09:57 PM.
 
Old 03-06-2010, 09:57 PM   #7
fancylad
Member
 
Registered: Mar 2008
Distribution: slackware
Posts: 175

Rep: Reputation: 19
you can do lsmod to find the modules you are currently using. also there is kernel config file that comes with the stock kernels. look in /boot. you can use this with "make menuconfig" when configuring the kernel so that all of the options from the stock kernel will be the same. then you can just add and remove what you like.

Last edited by fancylad; 03-06-2010 at 09:58 PM.
 
Old 03-06-2010, 10:00 PM   #8
vik
Member
 
Registered: Apr 2008
Distribution: Gentoo, FreeBSD
Posts: 225

Original Poster
Blog Entries: 8

Rep: Reputation: 50
Thanks, but lsmod doesn't show me where in the kernel menus the driver is located. Plus I have to plugin all of my USB devices and find where everything is with lsusb...
 
Old 03-06-2010, 10:04 PM   #9
damgar
Senior Member
 
Registered: Sep 2009
Location: dallas, tx
Distribution: Slackware - current multilib/gsb Arch
Posts: 1,949
Blog Entries: 8

Rep: Reputation: 203Reputation: 203Reputation: 203
Not loading any modules = huge kernel? With the new kernels there is the
Code:
make localmodconfig
option that will strip your kernel of all the modules you aren't currently using. The trick there will be to make sure you have EVERYTHING that might be plugged in via USB at some point connected and powered on at the time you issue the command. There is a thread on LQ with a good discussion on this. I would read that thread prior to building your kernel with that option. Even after that it's a good idea (read that as almost essential) to THEN double check everything with:
Code:
make gconfig
As was stated above, this won't neccessarily have an impact on performance. The processor type and features section when looking at
Code:
make gconfig
will be the most likely place to improve your performance by localizing it to your specific machine, changing preemption, etc. Compiling in support for your / partition's filesystem will likely allow you to do away with the need for an initrd. It's all that I need personally.

Google "alien kernel" to find Alien Bob's slackware kernel how-to. It's a good read and if you follow it, you won't be removing your old kernel, which is handy since stripping a kernel is a good way to have a non-bootable kernel.
 
Old 03-06-2010, 10:06 PM   #10
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Must have old-timers disease; I forgot (already) about this. Would be your best option these days.

Not loading modules (a one time effort) may be quicker to boot, but won't affect performance of the kernel.
 
Old 03-06-2010, 10:09 PM   #11
vik
Member
 
Registered: Apr 2008
Distribution: Gentoo, FreeBSD
Posts: 225

Original Poster
Blog Entries: 8

Rep: Reputation: 50
Thanks for that. I'll have to check if the 2.6.31 kernel has this option, as I'm trying to use Nvidia's propietary video driver and I've seen posts that it won't work with the newest.

I read up on Alien Bob's kernel guide a while back--I'll have to check if he's updated it.
 
Old 03-06-2010, 10:13 PM   #12
damgar
Senior Member
 
Registered: Sep 2009
Location: dallas, tx
Distribution: Slackware - current multilib/gsb Arch
Posts: 1,949
Blog Entries: 8

Rep: Reputation: 203Reputation: 203Reputation: 203
The 190.53 nvidia driver will work up to 2.6.32. With the patch it will work on 2.6.33. There was a recalled Nvidia driver (I'm actually running it now, and so far so good) that builds fine against the 2.6.33 kernel. I ran 190.53 for a month with the 2.6.33-rc5 kernel (I'm still running that kernel) It works fine.
 
Old 03-06-2010, 10:17 PM   #13
vik
Member
 
Registered: Apr 2008
Distribution: Gentoo, FreeBSD
Posts: 225

Original Poster
Blog Entries: 8

Rep: Reputation: 50
Thanks everyone. It looks like make localyesconfig is what I want here.

For future reference, here's the thread: http://www.linuxquestions.org/questi...localyesconfig

Here's a good reference for looking up kernel config options: http://cateee.net/lkddb/web-lkddb

Last edited by vik; 03-07-2010 at 09:05 AM.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
a few questions about modules in general that aren't part of the kernel dividingbyzero Linux - General 2 02-01-2009 01:52 PM
General C questions - for everyone vargadanis Programming 12 09-20-2006 11:43 AM
caos -> 2.6 kernel? and some general questions. shadowhunter cAos 4 03-02-2004 11:13 AM
Help Me: Few General Questions ?? alteredinsanity Linux - General 2 09-12-2002 01:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration