1

I used cat /proc/modules to list the process details. Below module shows as 4 instances are present:

poe_isr 3046 4 - Live 0xc37e1000 (O)

What does it mean? How do I see where these instances are being used? If the module is shwoing as 0 instances and Live, what does it mean? Module not loaded still Live?

adcmods 1565 0 - Live 0xc37dd000 (P)
3

It is a counter. It can be incremented or decremented by the kernel core API.

It is the responsibility of the modules, when do they increment it. For example, if you have a somefs module in the kernel, then the awaited behavior is to increment this counter with any mount of a somefs partition, and decrement it on unmount. On this way, somefs can guarantee that it won't be removed while there is a mounted somefs partition.

If the module usage counter is non-zero, rmmod fails on that module. But rmmod -f not, if forced module removal is compiled into the kernel.

Thus, the important things:

  • The increment and decrement of the counter is the responsibility of the modules, there is no sophisticated, generic reference tracking behind it.
  • In many cases, it works correctly, but not always. For example, some dirty modules, like ipv6 works on that way, that it increases the counter to 1 on insmod and never decreases. Thus, if you compiled ipv6 as module, you won't be ever able to rmmod it. Some video card driver works on similar way, because its routines what would deinitialize it, are missing. No such module can be a source of pride for its developers.
  • If you can't remove a module because of this, there is no general way to find out, what is exactly used by a module.
  • Does it mean that "poe_isr 3046 4 - Live 0xc37e1000 (O)" has only 1 instance currently running? How about "adcmods 1565 0 - Live 0xc37dd000 (P)" ? Here its 0 instance but Live, what does this indicate? – Ravi Dec 5 '17 at 4:57
  • @Ravi The question is, what you understand on "instance" here. If you understand on it: "how many times is it linked into kernel space", the answer is 1, and always 1, for all the modules, ever, independently from that usage counter number. – peterh Dec 5 '17 at 11:19
  • 1
    yes you got it right. – Ravi Dec 5 '17 at 11:53
1
poe_isr 3046 4 - Live 0xc37e1000 (O)

3rd column in this indicates that there are 4 dependent modules/processes. Hence rmmod won't work. 4th column indicates whether these are modules or non-modules. '-' indicates that 4 are non-modules. In the above example, poe_isr is dependent on 4 non-modules.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.