Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:wq_update_unbound_numa - update NUMA affinity of a wq for CPU hot[un]plug*@wq: the target workqueue*@cpu: the CPU coming up or going down*@online: whether @cpu is coming up or going down* This function is to be called from %CPU_DOWN_PREPARE, %CPU_ONLINE

Proto:static void wq_update_unbound_numa(struct workqueue_struct *wq, int cpu, bool online)

Type:void

Parameter:

TypeParameterName
struct workqueue_struct *wq
intcpu
boolonline
4077  node = cpu_to_node(cpu)
4078  cpu_off = If online Then -1 Else cpu
4079  old_pwq = NULL
4083  lockdep_assert_held( & wq_pool_mutex)
4085  If Not unbound NUMA affinity enabled || Not (hot fields used during command issue, aligned to cacheline & WQ_UNBOUND) || @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. Then Return
4094  target_attrs = uf for wq_update_unbound_numa_attrs(), protected by CPU hotplug exclusion
4095  cpumask = @cpumask: allowed CPUs
4097  copy_workqueue_attrs(target_attrs, PW: only for unbound wqs )
4098  pwq = bound_pwq_by_node - return the unbound pool_workqueue for the given node*@wq: the target workqueue*@node: the node ID* This must be called with any of wq_pool_mutex, wq->mutex or RCU* read locked
4106  If wq_calc_node_cpumask - calculate a wq_attrs' cpumask for the specified node*@attrs: the wq_attrs of the default pwq of the target workqueue*@node: the target NUMA node*@cpu_going_down: if >= 0, the CPU to consider as offline*@cpumask: outarg, the Then
4107  If pumask_equal - *src1p == *src2p*@src1p: the first input*@src2p: the second input Then Return
4109  Else
4110  Go to use_dfl_pwq
4114  pwq = btain a pool matching @attr and create a pwq associating the pool and @wq
4115  If Not pwq Then
4116  pr_warn("workqueue: allocation failed while updating NUMA affinity of \"%s\"\n", I: workqueue name )
4118  Go to use_dfl_pwq
4122  mutex_lock( & protects this wq )
4123  old_pwq = stall @pwq into @wq's numa_pwq_tbl[] for @node and return the old pwq
4124  Go to out_unlock
4126  use_dfl_pwq :
4127  mutex_lock( & protects this wq )
4128  spin_lock_irq( & he pool lock )
4129  get_pwq - get an extra reference on the specified pool_workqueue*@pwq: pool_workqueue to get* Obtain an extra reference on @pwq. The caller should guarantee that*@pwq has positive refcnt and be holding the matching pool->lock.
4130  spin_unlock_irq( & he pool lock )
4131  old_pwq = stall @pwq into @wq's numa_pwq_tbl[] for @node and return the old pwq
4132  out_unlock :
4133  mutex_unlock( & protects this wq )
4134  put_pwq_unlocked - put_pwq() with surrounding pool lock/unlock*@pwq: pool_workqueue to put (can be %NULL)* put_pwq() with locking. This function also allows %NULL @pwq.
Caller
NameDescribe
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