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-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull genirq updates from Thomas Gleixner.

* 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
genirq: Adjust irq thread affinity on IRQ_SET_MASK_OK_NOCOPY return value
genirq: Respect NUMA node affinity in setup_irq_irq affinity()
genirq: Get rid of unneeded force parameter in irq_finalize_oneshot()
genirq: Minor readablity improvement in irq_wake_thread()

+30 -15
+10 -6
kernel/irq/handle.c
··· 54 54 static void irq_wake_thread(struct irq_desc *desc, struct irqaction *action) 55 55 { 56 56 /* 57 - * Wake up the handler thread for this action. In case the 58 - * thread crashed and was killed we just pretend that we 59 - * handled the interrupt. The hardirq handler has disabled the 60 - * device interrupt, so no irq storm is lurking. If the 57 + * In case the thread crashed and was killed we just pretend that 58 + * we handled the interrupt. The hardirq handler has disabled the 59 + * device interrupt, so no irq storm is lurking. 60 + */ 61 + if (action->thread->flags & PF_EXITING) 62 + return; 63 + 64 + /* 65 + * Wake up the handler thread for this action. If the 61 66 * RUNTHREAD bit is already set, nothing to do. 62 67 */ 63 - if ((action->thread->flags & PF_EXITING) || 64 - test_and_set_bit(IRQTF_RUNTHREAD, &action->thread_flags)) 68 + if (test_and_set_bit(IRQTF_RUNTHREAD, &action->thread_flags)) 65 69 return; 66 70 67 71 /*
+13 -6
kernel/irq/manage.c
··· 282 282 { 283 283 struct irq_chip *chip = irq_desc_get_chip(desc); 284 284 struct cpumask *set = irq_default_affinity; 285 - int ret; 285 + int ret, node = desc->irq_data.node; 286 286 287 287 /* Excludes PER_CPU and NO_BALANCE interrupts */ 288 288 if (!irq_can_set_affinity(irq)) ··· 301 301 } 302 302 303 303 cpumask_and(mask, cpu_online_mask, set); 304 + if (node != NUMA_NO_NODE) { 305 + const struct cpumask *nodemask = cpumask_of_node(node); 306 + 307 + /* make sure at least one of the cpus in nodemask is online */ 308 + if (cpumask_intersects(mask, nodemask)) 309 + cpumask_and(mask, mask, nodemask); 310 + } 304 311 ret = chip->irq_set_affinity(&desc->irq_data, mask, false); 305 312 switch (ret) { 306 313 case IRQ_SET_MASK_OK: ··· 652 645 * is marked MASKED. 653 646 */ 654 647 static void irq_finalize_oneshot(struct irq_desc *desc, 655 - struct irqaction *action, bool force) 648 + struct irqaction *action) 656 649 { 657 650 if (!(desc->istate & IRQS_ONESHOT)) 658 651 return; ··· 686 679 * we would clear the threads_oneshot bit of this thread which 687 680 * was just set. 688 681 */ 689 - if (!force && test_bit(IRQTF_RUNTHREAD, &action->thread_flags)) 682 + if (test_bit(IRQTF_RUNTHREAD, &action->thread_flags)) 690 683 goto out_unlock; 691 684 692 685 desc->threads_oneshot &= ~action->thread_mask; ··· 746 739 747 740 local_bh_disable(); 748 741 ret = action->thread_fn(action->irq, action->dev_id); 749 - irq_finalize_oneshot(desc, action, false); 742 + irq_finalize_oneshot(desc, action); 750 743 local_bh_enable(); 751 744 return ret; 752 745 } ··· 762 755 irqreturn_t ret; 763 756 764 757 ret = action->thread_fn(action->irq, action->dev_id); 765 - irq_finalize_oneshot(desc, action, false); 758 + irq_finalize_oneshot(desc, action); 766 759 return ret; 767 760 } 768 761 ··· 851 844 wake_threads_waitq(desc); 852 845 853 846 /* Prevent a stale desc->threads_oneshot */ 854 - irq_finalize_oneshot(desc, action, true); 847 + irq_finalize_oneshot(desc, action); 855 848 } 856 849 857 850 static void irq_setup_forced_threading(struct irqaction *new)
+7 -3
kernel/irq/migration.c
··· 43 43 * masking the irqs. 44 44 */ 45 45 if (likely(cpumask_any_and(desc->pending_mask, cpu_online_mask) 46 - < nr_cpu_ids)) 47 - if (!chip->irq_set_affinity(&desc->irq_data, 48 - desc->pending_mask, false)) { 46 + < nr_cpu_ids)) { 47 + int ret = chip->irq_set_affinity(&desc->irq_data, 48 + desc->pending_mask, false); 49 + switch (ret) { 50 + case IRQ_SET_MASK_OK: 49 51 cpumask_copy(desc->irq_data.affinity, desc->pending_mask); 52 + case IRQ_SET_MASK_OK_NOCOPY: 50 53 irq_set_thread_affinity(desc); 51 54 } 55 + } 52 56 53 57 cpumask_clear(desc->pending_mask); 54 58 }