I'm thinking about how to do the mqueue "kernel allocated memory" accounting, and I have a problem. A user can create an mqueue of given size via sys_mq_open()Why not? mqueue_delete_inode can look at info->attr.mq_maxmsg and info->attr.mq_curmsg.
using "msg_attr" structure (will be created in do_create). I can account for how much memory has been allocated, but I can't at "deaccount" at kfree() time (this memory is stored in inode->(mqueue_inode_info *)info->messages), because I dont know how big
it is (its user selectable via "msg_attr" structure).