title: Why thread_info should be the first element in task_struct?
body: <p>When reading Linux kernel source code, I find one thing makes me confused.</p>
  
  <p>In <code>task_struct</code>, it says like this</p>
  
  <pre><code>struct task_struct {
  #ifdef CONFIG_THREAD_INFO_IN_TASK
      /*
       * For reasons of header soup (see current_thread_info()), this
       * must be the first element of task_struct.
       */
      struct thread_info      thread_info;
  #endif
  
  ...
  };
  </code></pre>
  
  <p>The complete code is <a href="https://elixir.bootlin.com/linux/v5.7-rc1/source/include/linux/sched.h#L632" rel="nofollow noreferrer">here</a>, can you tell me why this must be the first element in <code>task_struct</code>?</p>