Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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.

Proto:static struct worker *create_worker(struct worker_pool *pool)

Type:struct worker

Parameter:

TypeParameterName
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  If id < 0 Then Go to fail
1912  worker = alloc_worker(I: the associated node ID )
1913  If Not worker Then Go to fail
1916  I: worker id = id
1918  If I: the associated cpu >= 0 Then 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  Else 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  If IS_ERR(I: worker task ) Then Go to 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  wake_up_process(I: worker task )
1940  spin_unlock_irq( & he pool lock )
1942  Return worker
1944  fail :
1945  If id >= 0 Then ida_simple_remove( & worker IDs for task name , id)
1947  free previously allocated memory
1948  Return NULL
Caller
NameDescribe
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