views:

24

answers:

2

Hi,

Is there any way to list all the processes which are using/accessing a given Linux kernel driver?

I've got a (framebuffer) driver which I'm trying to rmmod, however the system is returning Module is in use, and I'd like to get to the bottom of it and see what process is still using it.

Can we get first the file descriptors that're been attributed by the system for interaction w/ the driver, then from there lookup the processes that own them?

-Ilyes Gouta

+1  A: 

If the device is /dev/fb0, then lsof /dev/fb0 should list the processes with it open.

It might also be held open by another kernel module - you can check that with lsmod.

caf
A: 

You can use "lsof" to see which processes are accessing a special file (e.g. /dev/fb0 or something).

However, this isn't guaranteed to work for all types of driver, some have kernel things which rely on them which aren't viewable with /dev/fb0.

MarkR