stap shows kfree() is 5 times more than kallocs, how could be?

Bernd Petrovitsch bernd at petrovitsch.priv.at
Mon Oct 15 08:30:10 EDT 2018


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pEpkey.asc
Type: application/pgp-keys
Size: 2472 bytes
Desc: not available
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20181015/68cdcf8a/attachment.bin>


More information about the Kernelnewbies mailing list