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 fix from Thomas Gleixner:
"A single fix for the new matrix allocator to prevent vector exhaustion
by certain network drivers which allocate gazillions of unused vectors
which cannot be put into reservation mode due to MSI and the lack of
MSI entry masking.

The fix/workaround is to spread the vectors across CPUs by searching
the supplied target CPU mask for the CPU with the smallest number of
allocated vectors"

* 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
irq/matrix: Spread interrupts on allocation

+14 -6
+14 -6
kernel/irq/matrix.c
··· 321 321 int irq_matrix_alloc(struct irq_matrix *m, const struct cpumask *msk, 322 322 bool reserved, unsigned int *mapped_cpu) 323 323 { 324 - unsigned int cpu; 324 + unsigned int cpu, best_cpu, maxavl = 0; 325 + struct cpumap *cm; 326 + unsigned int bit; 325 327 328 + best_cpu = UINT_MAX; 326 329 for_each_cpu(cpu, msk) { 327 - struct cpumap *cm = per_cpu_ptr(m->maps, cpu); 328 - unsigned int bit; 330 + cm = per_cpu_ptr(m->maps, cpu); 329 331 330 - if (!cm->online) 332 + if (!cm->online || cm->available <= maxavl) 331 333 continue; 332 334 335 + best_cpu = cpu; 336 + maxavl = cm->available; 337 + } 338 + 339 + if (maxavl) { 340 + cm = per_cpu_ptr(m->maps, best_cpu); 333 341 bit = matrix_alloc_area(m, cm, 1, false); 334 342 if (bit < m->alloc_end) { 335 343 cm->allocated++; ··· 346 338 m->global_available--; 347 339 if (reserved) 348 340 m->global_reserved--; 349 - *mapped_cpu = cpu; 350 - trace_irq_matrix_alloc(bit, cpu, m, cm); 341 + *mapped_cpu = best_cpu; 342 + trace_irq_matrix_alloc(bit, best_cpu, m, cm); 351 343 return bit; 352 344 } 353 345 }