函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\kthread.c Create Date:2022-07-27 10:30:33
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:kthread

函数原型:static int kthread(void *_create)

返回类型:int

参数:

类型参数名称
void *_create
217  create等于_create
218  int( * threadfn)(void * data) = threadfn
219  data等于data
224  self等于分配内存并置零
225  set_kthread_struct(self)
228  done等于xchg( & done, NULL)
229  如果非done
230  释放内存
231  do_exit( - EINTR)
234  如果非self
235  Result passed back to kthread_create() from kthreadd. 等于错误号
236  complete(done)
237  do_exit( - ENOMEM)
240  data等于data
241  init_completion( & exited)
242  init_completion( & parked)
243  vfork_done等于exited
246  set_current_state() includes a barrier so that the write of current->state* is correctly serialised wrt the caller's subsequent test of whether to* actually sleep:* for (;;) {* set_current_state(TASK_UNINTERRUPTIBLE);* if (!need_sleep)* break;* (深度睡眠态)
247  Result passed back to kthread_create() from kthreadd. 等于当前进程
248  complete(done)
249  schedule()
251  ret等于负EINTR
252  如果非st_bit - Determine whether a bit is set*@nr: bit number to test*@addr: Address to start counting from
253  cgroup_kthread_ready()
254  __kthread_parkme(self)
255  ret等于threadfn(data)
257  do_exit(ret)