Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:padata_do_parallel - padata parallelization function*@ps: padatashell*@padata: object to be parallelized*@cb_cpu: pointer to the CPU that the serialization callback function should* run on. If it's not in the serial cpumask of @pinst* (i

Proto:int padata_do_parallel(struct padata_shell *ps, struct padata_priv *padata, int *cb_cpu)

Type:int

Parameter:

TypeParameterName
struct padata_shell *ps
struct padata_priv *padata
int *cb_cpu
106  pinst = pinst
111  _read_lock_bh() - mark the beginning of an RCU-bh critical section* This is equivalent of rcu_read_lock(), but also disables softirqs
113  pd = fetch an RCU-bh-protected pointer for dereferencing(pd)
115  err = -EINVAL
116  If Not (flags & PADATA_INIT) || flags & PADATA_INVALID Then Go to out
119  If Not pumask_test_cpu - test for a cpu in a cpumask*@cpu: cpu number (< nr_cpu_ids)*@cpumask: the cpumask pointer* Returns 1 if @cpu is set in @cpumask, else returns 0 Then
120  If Not pumask_weight - Count of bits in *srcp*@srcp: the cpumask to count bits (< nr_cpu_ids) in. Then Go to out
124  cpu_index = cb_cpu % pumask_weight - Count of bits in *srcp*@srcp: the cpumask to count bits (< nr_cpu_ids) in.
126  cpu = Uniprocessor. Assume all masks are "1".
127  When i < cpu_index cycle cpu = pumask_next - get the next cpu in a cpumask*@n: the cpu prior to the place to search (ie. return will be > @n)*@srcp: the cpumask pointer* Returns >= nr_cpu_ids if no further cpus set.
130  cb_cpu = cpu
133  err = -EBUSY
134  If flags & PADATA_RESET Then Go to out
137  If atomic_read( & refcnt) >= MAX_OBJ_NUM Then Go to out
140  err = 0
141  atomic_inc( & refcnt)
142  pd = pd
143  cb_cpu = cb_cpu
145  seq_nr = atomic_inc_return( & seq_nr)
146  target_cpu = padata_cpu_hash(pd, seq_nr)
147  cpu = target_cpu
148  queue = per_cpu_ptr(pqueue, target_cpu)
150  spin_lock( & lock)
151  list_add_tail - add a new entry*@new: new entry to be added*@head: list head to add it before* Insert a new entry before the specified head.* This is useful for implementing queues.
152  spin_unlock( & lock)
154  queue_work - queue work on a workqueue*@wq: workqueue to use*@work: work to queue* Returns %false if @work was already on a queue, %true otherwise.* We queue the work to the CPU on which it was submitted, but if the CPU dies
156  out :
157  _read_unlock_bh - marks the end of a softirq-only RCU critical section* See rcu_read_lock_bh() for more information.
159  Return err