函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:put_unbound_pool - put a worker_pool*@pool: worker_pool to put* Put @pool

函数原型:static void put_unbound_pool(struct worker_pool *pool)

返回类型:void

参数:

类型参数名称
struct worker_pool *pool
3516  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:(detach_completion)
3519  lockdep_assert_held( & wq_pool_mutex)
3521  如果PL: refcnt for unbound pools 先自减则返回
3525  如果WARN_ON(!(I: the associated cpu < 0))或WARN_ON(!链表为空)则返回
3530  如果I: pool ID 大于等于0则删除释放idr
3532  从哈希表移除对象
3539  spin_lock_irq( & he pool lock )
3540  wait_event_lock_irq - sleep until a condition gets true(wq_manager_wait, !(X: flags & POOL_MANAGER_ACTIVE), he pool lock )
3542  X: flags 或等于POOL_MANAGER_ACTIVE
3544 worker等于Return the first idle worker. Safe with preemption disabled 循环
3545  destroy_worker - destroy a workqueue worker*@worker: worker to be destroyed* Destroy @worker and adjust @pool stats accordingly. The worker should* be idle.* CONTEXT:* spin_lock_irq(pool->lock).
3546  WARN_ON(L: total number of workers || L: currently idle workers )
3547  spin_unlock_irq( & he pool lock )
3549  mutex_lock( & wq_pool_attach_mutex)
3550  如果非链表为空all workers detached 等于detach_completion
3552  mutex_unlock( & wq_pool_attach_mutex)
3554  如果all workers detached wait_for_completion(all workers detached )
3558  del_timer_sync( & L: worker idle timeout )
3559  del_timer_sync( & L: SOS timer for workers )
3562  Exported common interfaces
调用者
名称描述
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
pwq_unbound_release_workfnScheduled on system_wq by put_pwq() when an unbound pwq hits zero refcnt* and needs to be destroyed.
alloc_unbound_pwqbtain a pool matching @attr and create a pwq associating the pool and @wq