Tuesday, 27 August 2013

per-task data structure in linux kernel module

per-task data structure in linux kernel module

I am writing a loadable kernel module for Linux. And I need to store some
data for each task in Linux kernel (These data would be used in a
scheduler callback).
I know that I can modify struct task_struct and insert my own fields. But
since I am willing to write a relatively clean kernel module, I cannot
modify any code resides in original Linux source tree.
It is also possible to maintain some sort of mapping from struct
task_struct to my data in a hash table. But it seem to be a little too
heavy-weight.
My question is: is there any simple and clean way that allows me
registering per-task data-structure in Linux kernel without modifying
struct task_struct?
Many thanks!

No comments:

Post a Comment