Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:__kthread_create_worker

Proto:static __printf(3, 0) struct kthread_worker *__kthread_create_worker(int cpu, unsigned int flags, const char namefmt[], va_list args)

Type:struct kthread_worker

Parameter:

TypeParameterName
intcpu
unsigned intflags
const charnamefmt
va_listargs
687  node = NUMA_NO_NODE
689  worker = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
690  If Not worker Then Return ERR_PTR( - ENOMEM)
693  kthread_init_worker(worker)
695  If cpu >= 0 Then node = cpu_to_node(cpu)
698  task = __kthread_create_on_node(kthread_worker_fn - kthread function to process kthread_worker*@worker_ptr: pointer to initialized kthread_worker* This function implements the main cycle of kthread worker. It processes* work_list until it is stopped with kthread_stop(), worker, node, namefmt, args)
700  If IS_ERR(task) Then Go to fail_task
703  If cpu >= 0 Then kthread_bind - bind a just-created kthread to a cpu
706  flags = flags
707  task = task
708  wake_up_process(task)
709  Return worker
711  fail_task :
712  free previously allocated memory
713  Return ERR_CAST - Explicitly cast an error-valued pointer to another pointer type*@ptr: The pointer to cast.* Explicitly cast an error-valued pointer to another pointer type in such a* way as to make it clear that's what's going on.
Caller
NameDescribe
kthread_create_workerkthread_create_worker - create a kthread worker*@flags: flags modifying the default behavior of the worker*@namefmt: printf-style name for the kthread worker (task)
kthread_create_worker_on_cpukthread_create_worker_on_cpu - create a kthread worker and bind it* it to a given CPU and the associated NUMA node