Wednesday, July 25, 2007

Linux Kernel Threads Can Have Priorities and Can Dereference current

My memory failed me on some points of kernel threads today so hopefully this post will solidify my knowledge.
  • Kernel threads can have a priority via the "nice" mechanism. It is set using set_user_nice(tsk, nice_level), just as for userspace processes/threads.
  • As a consequence of the above point, kernel threads have a task structure and it may be referred to by the current pointer, again, the same as is the case with userspace processes/threads.
set_user_nice() should be called from within the task callback function supplied to kthread_create().

No comments: