(what is probably the first in a plethora of silly questions as i dig into the ugly details of various kernel features. you've been warned.) clawing my way through the kernel code for kthreads and i notice the following. in kernel/kthread.c, we have: === struct kthread { int should_stop; void *data; struct completion exited; }; #define to_kthread(tsk) \ container_of((tsk)->vfork_done, struct kthread, exited) === in other words, the kthread to associated "task_struct" mapping is based on the fact that this member field in task_struct: struct completion *vfork_done; /* for vfork() */ will point at the "exited" completion object in the corresponding "struct kthread". is the above construct only true for kthreads, in the sense of, unless you've specifically created a kthread, the vfork_done pointer in task_struct is to a simple completion. but if the task is a kthread, the vfork_done pointer is *still* to a completion, but it's a completion that's encapsulated in a larger structure that's meant to be manipulated by kthread routines, obviously. as a test, i did this: === $ grep -r "container_of.*vfork_done" * kernel/kthread.c: container_of((tsk)->vfork_done, struct kthread, exited) $ === so it appears that that vfork_done field is only ever "container_of"ed with respect to kthreads and nowhere else. thoughts? rday -- ======================================================================== Robert P. J. Day Ottawa, Ontario, CANADA http://crashcourse.ca Twitter: http://twitter.com/rpjday LinkedIn: http://ca.linkedin.com/in/rpjday ======================================================================== _______________________________________________ Kernelnewbies mailing list Kernelnewbies@xxxxxxxxxxxxxxxxx http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies