KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
lsmod , /proc/modules and slabinfo , /proc/meminfo does NOT give how much memory my kernel module is using is there a way to find this out ? btw, I wrote a small test program basically, a device driver that takes ioctl call to alloc 1MB and I send this ioctl message every second from my application so my drive does kmalloc every second. Iam not able to see the increase in "cat /proc/meminfo | grep Slab " -- snip --- int device_ioctl( struct file *file, unsigned int ioctl_num, unsigned long ioctl_param) { /* * Switch according to the ioctl called */ printk ( "<l> inside ioctl %d IOCTL_ALLOC_MSG = %d\n", ioctl_num,IOCTL_ALLOC_MSG ); switch (ioctl_num) { case IOCTL_ALLOC_MSG: allocfunc(); // kmalloc 1MB // printk in this function is OK break; case IOCTL_DEALLOC_MSG: deallocfunc(); break; } return 0; } Application/user space while ( !stop ) { ret_val = ioctl(memfile, IOCTL_ALLOC_MSG); if (ret_val < 0) { printf("ioctl failed. Return code: %d, meaning: %s\n", ret_val, strerror(errno)); return -1; } sleep ( 10 ); } I dont see the growth of memory in slabinfo. I know linux does cache->slabs->pages->objects but there must be some way in user land to determine the memory size of a particular kernel module. Thanks,
Tags (comma-separated)
Save Edits
Cancel