linux-modules.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFE] Who's using a module?
@ 2020-03-11 13:27 Konstantin Kharlamov
  2020-03-12  6:53 ` Konstantin Kharlamov
  2020-03-13 16:22 ` Lucas De Marchi
  0 siblings, 2 replies; 6+ messages in thread
From: Konstantin Kharlamov @ 2020-03-11 13:27 UTC (permalink / raw)
  To: linux-modules

Once in a while there's a need to remove a module (for example because you rebuilt it, or to reload it with different parameters, or whatever…). And then doing `rmmod modulename` and `modprobe -r modulename` gives:

	rmmod: ERROR: Module modulename is in use

If you're lucky, firing up `lsmod | grep modulename` will get you offenders inside "used by" column. But often there's nothing except the count above zero. It is very easy to reproduce if you check `lsmod` output for your graphics driver. I checked it on `i915` and `amdgpu`: when graphics session is opened you can't remove it and `lsmod` doesn't show who's using it.

There's very popular and old question on SO¹ that at the moment has over 55k views, and the only answer that seem to work for people is insanely big and convoluted; it is using a custom kernel driver and kernel tracing capabilities. I guess this amount of research means: no, currently there's no easy way to get who's using a module.

It would be amazing if kernel has capability to figure out who's using a module.

1: https://stackoverflow.com/questions/448999/is-there-a-way-to-figure-out-what-is-using-a-linux-kernel-module

P.S.: please, add me to CC when replying, I'm not subscribed to the list.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-03-16 17:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-11 13:27 [RFE] Who's using a module? Konstantin Kharlamov
2020-03-12  6:53 ` Konstantin Kharlamov
2020-03-13 16:22 ` Lucas De Marchi
2020-03-13 17:29   ` Steven Rostedt
2020-03-16  8:49   ` David Laight
2020-03-16 17:34   ` Jessica Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).