函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:__irq_build_affinity_masks

函数原型:static int __irq_build_affinity_masks(unsigned int startvec, unsigned int numvecs, unsigned int firstvec, cpumask_var_t *node_to_cpumask, const struct cpumask *cpu_mask, struct cpumask *nmsk, struct irq_affinity_desc *masks)

返回类型:int

参数:

类型参数名称
unsigned intstartvec
unsigned intnumvecs
unsigned intfirstvec
cpumask_var_t *node_to_cpumask
const struct cpumask *cpu_mask
struct cpumask *nmsk
struct irq_affinity_desc *masks
255  done等于0
256  last_affv等于firstvecnumvecs
257  curvec等于startvec
258  nodemsk等于NODE_MASK_NONE
261  如果非pumask_weight - Count of bits in *srcp*@srcp: the cpumask to count bits (< nr_cpu_ids) in.则返回:0
264  nodes等于get_nodes_in_cpumask(node_to_cpumask, cpu_mask, & nodemsk)
270  如果numvecs小于等于nodes
272  pumask_or - *dstp = *src1p | *src2p*@dstp: the cpumask result*@src1p: the first input*@src2p: the second input
274  如果curvec先自加恒等于last_affvcurvec等于firstvec
277  返回:numvecs
280  node_vectors等于分配数组内存并置零
283  如果非node_vectors则返回:负ENOMEM
287  Allocate vector number for each node, so that for each node:* 1) the allocated number is >= 1* 2) the allocated numbver is <= active CPU number of this node* The actual allocated total vectors may be less than @numvecs when
290 i小于nr_node_ids循环
292  nv等于node_vectors[i]
294  如果nvectors恒等于UINT_MAX则继续下一循环
298  pumask_and - *dstp = *src1p & *src2p*@dstp: the cpumask result*@src1p: the first input*@src2p: the second input* If *@dstp is empty, returns 0, else returns 1
299  ncpus等于pumask_weight - Count of bits in *srcp*@srcp: the cpumask to count bits (< nr_cpu_ids) in.
300  如果非ncpus则继续下一循环
303  WARN_ON_ONCE(nvectors > ncpus)
306  extra_vecs等于ncpusnvectorsncpusnvectors
309 v小于nvectors循环
310  cpus_per_vec等于ncpusnvectors
313  如果extra_vecs
314  cpus_per_vec自加
315  extra_vecs先自减
322  如果curvec大于等于last_affvcurvec等于firstvec
327  done加等于nvectors
329  释放内存
330  返回:done
调用者
名称描述
irq_build_affinity_masksld affinity in two stages:* 1) spread present CPU on these vectors* 2) spread other possible CPUs on these vectors