函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:reate_worker - create a new workqueue worker*@pool: pool the new worker will belong to* Create and start a new worker which is attached to @pool.* CONTEXT:* Might sleep. Does GFP_KERNEL allocations.* Return:* Pointer to the newly created worker.

函数原型:static struct worker *create_worker(struct worker_pool *pool)

返回类型:struct worker

参数:

类型参数名称
struct worker_pool *pool
1903  struct worker * worker = NULL
1904  id等于负1
1908  id等于ida_simple_get( & worker IDs for task name , 0, 0, GFP_KERNEL)
1909  如果id小于0则转到:fail
1912  worker等于alloc_worker(I: the associated node ID )
1913  如果非worker则转到:fail
1916  I: worker id 等于id
1918  如果I: the associated cpu 大于等于0则snprintf - 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*@
1921  否则snprintf - 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*@
1924  I: worker task 等于kthread_create_on_node(worker_thread, worker, I: the associated node ID , "kworker/%s", id_buf)
1926  如果是错误则转到:fail
1929  set_user_nice(I: worker task , @nice: nice level)
1930  kthread_bind_mask(I: worker task , @cpumask: allowed CPUs)
1933  worker_attach_to_pool() - attach a worker to a pool*@worker: worker to be attached*@pool: the target pool* Attach @worker to @pool. Once attached, the %WORKER_UNBOUND flag and* cpu-binding of @worker are kept coordinated with the pool across
1936  spin_lock_irq( & he pool lock )
1937  nr_workers自加
1938  worker_enter_idle - enter idle state*@worker: worker which is entering idle state*@worker is entering idle state. Update stats and idle timer if* necessary.* LOCKING:* spin_lock_irq(pool->lock).
1939  唤醒中断线程
1940  spin_unlock_irq( & he pool lock )
1942  返回:worker
1944  fail :
1945  如果id大于等于0则ida_simple_remove( & worker IDs for task name , id)
1947  释放内存
1948  返回:NULL
调用者
名称描述
maybe_create_workermaybe_create_worker - create a new worker if necessary*@pool: pool to create a new worker for* Create a new worker for @pool if necessary
get_unbound_poolget_unbound_pool - get a worker_pool with the specified attributes*@attrs: the attributes of the worker_pool to get* Obtain a worker_pool which has the same attributes as @attrs, bump the* reference count and return it
workqueue_initworkqueue_init - bring workqueue subsystem fully online* This is the latter half of two-staged workqueue subsystem initialization* and invoked as soon as kthreads can be created and scheduled