You are not logged in.

#1 2009-10-13 22:30:34

kapz
Member
Registered: 2009-03-26
Posts: 88
Website

[SOLVED]Lsmod explanation - How it works!

Hi all! Its kind of a silly question but want to know how lsmod works. Man and info pages does not have enough information and so do google. When I do lsmod it shows columns, first is 'modules', 'in use' etc..

Now there are a lot of modules that show blank in 'in use' column, like example ipv6 shows not used by anything. So should I assume that its not required by system/device, as of now and that its unnecessary burdeon and should be removed? or how it works?

Any answer is most appreciated.

Last edited by kapz (2009-10-15 14:17:13)


I wonder how it would be like to use the rest 99% of my brain..:P

Registered Linux User: 487155

Offline

#2 2009-10-13 22:33:49

MrGone
Member
Registered: 2009-09-30
Posts: 23

Re: [SOLVED]Lsmod explanation - How it works!

Do you mean the "Used by" column?

This just indicates that it is required by the other listed modules. If there is nothing listed it means that nothing is dependant on it but that isn't the same as that it isn't doing anything.

Offline

#3 2009-10-14 00:11:42

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: [SOLVED]Lsmod explanation - How it works!

MrGone wrote:

This just indicates that it is required by the other listed modules.

Not only by other modules, but also by the stuff on the system, e.g. apps using the sound device will increment the counter for the snd_xxx module. Only when the count is 0, can you unload the module.

Last edited by lucke (2009-10-14 00:17:16)

Offline

#4 2009-10-14 09:01:44

kapz
Member
Registered: 2009-03-26
Posts: 88
Website

Re: [SOLVED]Lsmod explanation - How it works!

sorry I meant 'Used by' and not 'in use'.

Thanks for the answer..so there are a LOT of modules which show count as 0, so does this mean they are not required/unnecessary. In that case to remove them should I use rmmod only or after that I need to delete them manually as well?

Edit*  Strange thing is both of my NIC card modules are showing count 0 in Used by column, but I am very well using it right now!  *Edit

Last edited by kapz (2009-10-14 09:08:50)


I wonder how it would be like to use the rest 99% of my brain..:P

Registered Linux User: 487155

Offline

#5 2009-10-14 13:23:02

ataraxia
Member
From: Pittsburgh
Registered: 2007-05-06
Posts: 1,553

Re: [SOLVED]Lsmod explanation - How it works!

For what it's worth, lsmod does very little. It just reads /proc/modules and reformats it for you. So the real answers are found inside the kernel.

Offline

#6 2009-10-14 19:05:55

kapz
Member
Registered: 2009-03-26
Posts: 88
Website

Re: [SOLVED]Lsmod explanation - How it works!

Hi ataraxia can you please explain:

the real answers are found inside the kernel.


I wonder how it would be like to use the rest 99% of my brain..:P

Registered Linux User: 487155

Offline

#7 2009-10-14 19:37:44

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: [SOLVED]Lsmod explanation - How it works!

Unloading some modules, like filesystem's, could have drastic consequences. Others, like NIC's modules, aren't as crucial.

Offline

#8 2009-10-14 20:07:32

ataraxia
Member
From: Pittsburgh
Registered: 2007-05-06
Posts: 1,553

Re: [SOLVED]Lsmod explanation - How it works!

kapz wrote:

Hi ataraxia can you please explain:

the real answers are found inside the kernel.

I mean, that you have to read the kernel code that writes /proc/modules to know what is happening. I've never read any of this code myself.

Offline

#9 2009-10-15 07:53:57

bender02
Member
From: UK
Registered: 2007-02-04
Posts: 1,328

Re: [SOLVED]Lsmod explanation - How it works!

You can get a little (usually really very little) info about a module by running 'modinfo <modulename>'.

Offline

#10 2009-10-15 08:38:14

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: [SOLVED]Lsmod explanation - How it works!

I find it's a lot of info that modinfo prints... PCI code matches, a little info (yes wink) about what the module does, and most importantly: module loading parameters. Especially the latter can be invaluable.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#11 2009-10-15 14:15:38

kapz
Member
Registered: 2009-03-26
Posts: 88
Website

Re: [SOLVED]Lsmod explanation - How it works!

Ow, so the total package to understand that would be - - kernel sources,modules,lsmod,depmod,modprobe and modinfo...

all of which I cant differentiate between kernel sources and kernel module sources or kernel sources and kernel modules...!
But thanks for the pointer you all. Will mark it as closed as to understand this would require some homework..


I wonder how it would be like to use the rest 99% of my brain..:P

Registered Linux User: 487155

Offline

Board footer

Powered by FluxBB