| Function report | 
| Source Code: kernel\irq\affinity.c | Create Date:2022-07-28 10:15:57 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:__irq_build_affinity_masks
Proto: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)
Type:int
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| 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 | 
| 255 | done = 0 | 
| 258 | nodemsk = NODE_MASK_NONE | 
| 261 | If Not pumask_weight - Count of bits in *srcp*@srcp: the cpumask to count bits (< nr_cpu_ids) in. Then Return 0 | 
| 264 | nodes = get_nodes_in_cpumask(node_to_cpumask, cpu_mask, & nodemsk) | 
| 277 | Return numvecs | 
| 280 | node_vectors = kcalloc - allocate memory for an array. The memory is set to zero.*@n: number of elements.*@size: element size.*@flags: the type of memory to allocate (see kmalloc). | 
| 283 | If Not node_vectors Then Return -ENOMEM | 
| 290 | When i < nr_node_ids cycle | 
| 292 | nv = node_vectors[i] | 
| 299 | ncpus = pumask_weight - Count of bits in *srcp*@srcp: the cpumask to count bits (< nr_cpu_ids) in. | 
| 300 | If Not ncpus Then Continue | 
| 303 | WARN_ON_ONCE(nvectors > ncpus) | 
| 306 | extra_vecs = ncpus - nvectors * ncpus / nvectors | 
| 310 | cpus_per_vec = ncpus / nvectors | 
| 313 | If extra_vecs Then | 
| 314 | cpus_per_vec++ | 
| 315 | --extra_vecs | 
| 324 | irq_spread_init_one( & mask, nmsk, cpus_per_vec) | 
| 330 | Return done | 
| Name | Describe | 
|---|---|
| irq_build_affinity_masks | ld affinity in two stages:* 1) spread present CPU on these vectors* 2) spread other possible CPUs on these vectors | 
| Source code conversion tool public plug-in interface | X | 
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |