Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull irq fixes from Thomas Gleixner:
"The irq department provides:

- two fixes for the CPU affinity spread infrastructure to prevent
unbalanced spreading in corner cases which leads to horrible
performance, because interrupts are rather aggregated than spread

- add a missing spinlock initializer in the imx-gpcv2 init code"

* 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
irqchip/irq-imx-gpcv2: Fix spinlock initialization
irq/affinity: Fix extra vecs calculation
irq/affinity: Fix CPU spread for unbalanced nodes

+13 -9
+2
drivers/irqchip/irq-imx-gpcv2.c
··· 230 230 return -ENOMEM; 231 231 } 232 232 233 + raw_spin_lock_init(&cd->rlock); 234 + 233 235 cd->gpc_base = of_iomap(node, 0); 234 236 if (!cd->gpc_base) { 235 237 pr_err("fsl-gpcv2: unable to map gpc registers\n");
+11 -9
kernel/irq/affinity.c
··· 59 59 struct cpumask * 60 60 irq_create_affinity_masks(int nvecs, const struct irq_affinity *affd) 61 61 { 62 - int n, nodes, vecs_per_node, cpus_per_vec, extra_vecs, curvec; 62 + int n, nodes, cpus_per_vec, extra_vecs, curvec; 63 63 int affv = nvecs - affd->pre_vectors - affd->post_vectors; 64 64 int last_affv = affv + affd->pre_vectors; 65 65 nodemask_t nodemsk = NODE_MASK_NONE; ··· 94 94 goto done; 95 95 } 96 96 97 - /* Spread the vectors per node */ 98 - vecs_per_node = affv / nodes; 99 - /* Account for rounding errors */ 100 - extra_vecs = affv - (nodes * vecs_per_node); 101 - 102 97 for_each_node_mask(n, nodemsk) { 103 - int ncpus, v, vecs_to_assign = vecs_per_node; 98 + int ncpus, v, vecs_to_assign, vecs_per_node; 99 + 100 + /* Spread the vectors per node */ 101 + vecs_per_node = (affv - curvec) / nodes; 104 102 105 103 /* Get the cpus on this node which are in the mask */ 106 104 cpumask_and(nmsk, cpu_online_mask, cpumask_of_node(n)); 107 105 108 106 /* Calculate the number of cpus per vector */ 109 107 ncpus = cpumask_weight(nmsk); 108 + vecs_to_assign = min(vecs_per_node, ncpus); 109 + 110 + /* Account for rounding errors */ 111 + extra_vecs = ncpus - vecs_to_assign * (ncpus / vecs_to_assign); 110 112 111 113 for (v = 0; curvec < last_affv && v < vecs_to_assign; 112 114 curvec++, v++) { ··· 117 115 /* Account for extra vectors to compensate rounding errors */ 118 116 if (extra_vecs) { 119 117 cpus_per_vec++; 120 - if (!--extra_vecs) 121 - vecs_per_node++; 118 + --extra_vecs; 122 119 } 123 120 irq_spread_init_one(masks + curvec, nmsk, cpus_per_vec); 124 121 } 125 122 126 123 if (curvec >= last_affv) 127 124 break; 125 + --nodes; 128 126 } 129 127 130 128 done: