Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\kthread.c Create Date:2022-07-28 09:30:15
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:__kthread_create_on_node

Proto:static __printf(4, 0) struct task_struct *__kthread_create_on_node(int (*threadfn)(void *data), void *data, int node, const char namefmt[], va_list args)

Type:struct task_struct

Parameter:

TypeParameterName
int (*threadfn
void *data
intnode
const charnamefmt
va_listargs
298  Lockdep needs to run a non-constant initializer for on-stack* completions - so we use the _ONSTACK() variant for those that* are on the kernel stack:(done)
300  create = Allocation memory
303  If Not create Then Return ERR_PTR( - ENOMEM)
305  threadfn = threadfn
306  data = data
307  node = node
308  done = done
310  spin_lock( & kthread_create_lock)
311  list_add_tail - add a new entry*@new: new entry to be added*@head: list head to add it before* Insert a new entry before the specified head.* This is useful for implementing queues.
312  spin_unlock( & kthread_create_lock)
314  wake_up_process(kthreadd_task)
320  If Value for the false possibility is greater at compile time(wait_for_completion_killable( & done)) Then
326  If xchg( & done, NULL) Then Return ERR_PTR( - EINTR)
332  wait_for_completion( & done)
334  task = Result passed back to kthread_create() from kthreadd.
335  If Not IS_ERR(task) Then
336  static const struct sched_param param = {sched_priority = 0}
343  vsnprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@size: The size of the buffer, including the trailing null space*@fmt: The format string to use*@args: Arguments for the format string* This function generally
344  set_task_comm(task, name)
349  sched_setscheduler_nocheck(task, Scheduling policies, & param)
350  set_cpus_allowed_ptr(task, cpu_all_mask)
352  free previously allocated memory
353  Return task
Caller
NameDescribe
kthread_create_on_nodekthread_create_on_node - create a kthread
__kthread_create_worker