title: How does the kernel use task_struct?
body: <p>I am a student doing research involving Linux processes, and I need to learn more about them to proceed with my experiment. In reading a couple books and things online, I've come across <code>task_struct</code>, which I'm not sure I'm understanding fully, and would like confirmation/correction onto my existing thought.</p>
  
  <p>From what I think I've understood, <code>task_struct</code> is the C structure that acts as the process descriptor, holding everything the kernel might need to know about a processes. At the end of the process kernel stack lives another struct, <code>thread_info</code>, which has a pointer to the processes <code>task_struct</code>.</p>
  
  <p>Another question: how does one access the <code>task_struct</code> of a process? Is there a calculation to find the location of it's <code>thread_info</code>? Is there a macro/function within the kernel?</p>