1. 14 12月, 2021 3 次提交
    • E
      kthread: Ensure struct kthread is present for all kthreads · 40966e31
      Eric W. Biederman 提交于
      Today the rules are a bit iffy and arbitrary about which kernel
      threads have struct kthread present.  Both idle threads and thread
      started with create_kthread want struct kthread present so that is
      effectively all kernel threads.  Make the rule that if PF_KTHREAD
      and the task is running then struct kthread is present.
      
      This will allow the kernel thread code to using tsk->exit_code
      with different semantics from ordinary processes.
      
      To make ensure that struct kthread is present for all
      kernel threads move it's allocation into copy_process.
      
      Add a deallocation of struct kthread in exec for processes
      that were kernel threads.
      
      Move the allocation of struct kthread for the initial thread
      earlier so that it is not repeated for each additional idle
      thread.
      
      Move the initialization of struct kthread into set_kthread_struct
      so that the structure is always and reliably initailized.
      
      Clear set_child_tid in free_kthread_struct to ensure the kthread
      struct is reliably freed during exec.  The function
      free_kthread_struct does not need to clear vfork_done during exec as
      exec_mm_release called from exec_mmap has already cleared vfork_done.
      Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      40966e31
    • E
      exit: Rename complete_and_exit to kthread_complete_and_exit · cead1855
      Eric W. Biederman 提交于
      Update complete_and_exit to call kthread_exit instead of do_exit.
      
      Change the name to reflect this change in functionality.  All of the
      users of complete_and_exit are causing the current kthread to exit so
      this change makes it clear what is happening.
      
      Move the implementation of kthread_complete_and_exit from
      kernel/exit.c to to kernel/kthread.c.  As this function is kthread
      specific it makes most sense to live with the kthread functions.
      
      There are no functional change.
      Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      cead1855
    • E
      exit: Rename module_put_and_exit to module_put_and_kthread_exit · ca3574bd
      Eric W. Biederman 提交于
      Update module_put_and_exit to call kthread_exit instead of do_exit.
      
      Change the name to reflect this change in functionality.  All of the
      users of module_put_and_exit are causing the current kthread to exit
      so this change makes it clear what is happening.  There is no
      functional change.
      Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      ca3574bd
  2. 18 11月, 2021 1 次提交
  3. 13 11月, 2021 11 次提交
  4. 12 11月, 2021 12 次提交
  5. 11 11月, 2021 7 次提交
  6. 10 11月, 2021 6 次提交