Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

Proto:static struct worker_pool *get_unbound_pool(const struct workqueue_attrs *attrs)

Type:struct worker_pool

Parameter:

TypeParameterName
const struct workqueue_attrs *attrs
3581  hash = hash value of the content of @attr
3584  target_node = NUMA_NO_NODE
3586  lockdep_assert_held( & wq_pool_mutex)
3589  hash_for_each_possible - iterate over all possible objects hashing to the* same bucket*@name: hashtable to iterate*@obj: the type * to use as a loop cursor for each entry*@member: the name of the hlist_node within the struct*@key: the key of the objects (PL: hash of all unbound pools keyed by pool->attrs , pool, hash_node, hash)
3590  If ent equality test Then
3592  Return pool
3597  If unbound NUMA affinity enabled Then
3601  target_node = node
3602  Break
3608  pool = kzalloc_node - allocate zeroed memory from a particular memory node.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).*@node: memory node from which to allocate
3609  If Not pool || _worker_pool - initialize a newly zalloc'd worker_pool*@pool: worker_pool to initialize* Initialize a newly zalloc'd @pool < 0 Then Go to fail
3612  lockdep_set_subclass( & he pool lock , 1)
3613  copy_workqueue_attrs(I: worker attributes , attrs)
3614  I: the associated node ID = target_node
3620  @no_numa: disable NUMA affinity* Unlike other fields, ``no_numa`` isn't a property of a worker_pool. It* only modifies how :c:func:`apply_workqueue_attrs` select pools and thus* doesn't participate in pool hash calculations or equality comparisons. = false
3622  If worker_pool_assign_id - allocate ID and assing it to @pool*@pool: the pool pointer of interest* Returns 0 if ID in [0, WORK_OFFQ_POOL_NONE) is allocated and assigned* successfully, -errno on failure. < 0 Then Go to fail
3626  If can kworkers be created yet? && Not 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. Then Go to fail
3630  hash_add - add an object to a hashtable*@hashtable: hashtable to add to*@node: the &struct hlist_node of the object to be added*@key: the key of the object to be added(PL: hash of all unbound pools keyed by pool->attrs , & PL: unbound_pool_hash node , hash)
3632  Return pool
3633  fail :
3634  If pool Then put_unbound_pool - put a worker_pool*@pool: worker_pool to put* Put @pool
3636  Return NULL
Caller
NameDescribe
alloc_unbound_pwqbtain a pool matching @attr and create a pwq associating the pool and @wq