Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The "sudo lsmod|egrep procfs3" shows -1 on the "used by" column #194

Closed
tclee060219sat opened this issue Mar 30, 2023 · 3 comments
Closed
Assignees

Comments

@tclee060219sat
Copy link

tclee060219sat commented Mar 30, 2023

Shown below is the procfs3 insmod/lsmod/rmmod scenario. I am figuring out why -1 is on its 3rd column. Comment please. FYI, the same command sequence for procfs1.ko and procfs2.ko succeeded.

lkmpg/examples$ ls -lrt procfs3.*
-rw-rw-r-- 1 tclee tclee     98  3月 27 14:37 procfs3.mod
-rw-rw-r-- 1 tclee tclee     98  3月 27 14:37 procfs3.mod
-rw-rw-r-- 1 tclee tclee   3445  3月 30 14:54 procfs3.c.mar30thu23.0254pm
-rw-rw-r-- 1 tclee tclee   1253  3月 30 15:24 procfs3.mod.c
-rw-rw-r-- 1 tclee tclee  50200  3月 30 15:24 procfs3.mod.o
-rw-rw-r-- 1 tclee tclee   3021  3月 30 15:34 procfs3.c
-rw-rw-r-- 1 tclee tclee 166288  3月 30 15:34 procfs3.o
-rw-rw-r-- 1 tclee tclee 214984  3月 30 15:34 procfs3.ko
lkmpg/examples$ sudo lsmod|egrep procfs
procfs3                16384  -1
lkmpg/examples$ sudo rmmod procfs3
lkmpg/examples$ sudo lsmod|egrep procfs
procfs3                16384  -1
@jserv
Copy link
Contributor

jserv commented Mar 31, 2023

@tclee060219sat, I annotated your message for better illustration. Please do that always.

@linD026
Copy link
Collaborator

linD026 commented Mar 31, 2023

Not sure what is happening on your side, although it might be related to the try_module_get [1].
I don't have this problem with 5.4.0-80-generic kernel:

ubuntu@ubuntu:~/lkmpg/examples$ sudo insmod procfs3.ko
ubuntu@ubuntu:~/lkmpg/examples$ sudo lsmod|egrep procfs3
procfs3                20480  0
ubuntu@ubuntu:~/lkmpg/examples$ sudo rmmod procfs3 
ubuntu@ubuntu:~/lkmpg/examples$ sudo lsmod|egrep procfs3
ubuntu@ubuntu:~/lkmpg/examples$ 

Could you please provide more information?

@tclee060219sat
Copy link
Author

tclee060219sat commented Mar 31, 2023 via email

@jserv jserv closed this as completed Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants