stap shows kfree() is 5 times more than kallocs, how could be?
Hello all, I am debugging kernel module and use SystemTap to monitor requested and freed memory. I see that SystemTap statistics shows that kfree() is called 5 times more than kalloc. It happens not only on my module, it happens on VirtualBox vboxsf driver as well. See hits count below kmalloc hits: 21561 kfree hits: 102175 ----- probe hit report: kernel.function("__kmalloc@mm/slub.c:3706"), (./kmalloc_argus.stp:10:1), hits: 21561, cycles: 21228min/52226avg/334688max, from: kernel.function("__kmalloc@mm/slub.c:3706") from: kernel.function("__kmalloc"), index: 0 kernel.function("__kmalloc@mm/slub.c:3706").return, (./kmalloc_argus.stp:25:1), hits: 21561, cycles: 18843min/51228avg/406816max, from: kernel.function("__kmalloc@mm/slub.c:3706").return from: kernel.function("__kmalloc").return, index: 1 kernel.function("kfree@mm/slub.c:3843"), (./kmalloc_argus.stp:38:1), hits: 102175, cycles: 400min/1557avg/499754max, from: kernel.function("kfree@mm/slub.c:3843") from: kernel.function("kfree"), index: 2 Please comment. Lev
Hi all! On 15/10/18 14:17, Lev Olshvang wrote: [...]
I am debugging kernel module and use SystemTap to monitor requested and freed memory.
I see that SystemTap statistics shows that kfree() is called 5 times more than kalloc. It happens not only on my module, it happens on VirtualBox vboxsf driver as well.
See hits count below kmalloc hits: 21561 kfree hits: 102175
"kfree(NULL)" is a legal NO-OP (and basically all other similar functions are expected to gracefully accept a NULL pointer). MfG, Bernd -- "I dislike type abstraction if it has no real reason. And saving on typing is not a good reason - if your typing speed is the main issue when you're coding, you're doing something seriously wrong." - Linus Torvalds
participants (2)
-
Bernd Petrovitsch -
Lev Olshvang