History

genirq: Minor readablity improvement in irq_wake_thread()

exit_irq_thread() clears IRQTF_RUNTHREAD flag and drops the thread's bit in desc->threads_oneshot then. The bit must not be set again in between and it does not, since irq_wake_thread() sees PF_EXITING flag first and returns. Due to above the order or checking PF_EXITING and IRQTF_RUNTHREAD flags in irq_wake_thread() is important. This change just makes it more visible in the source code.

Alexander Gordeev committed 14 years ago

Commit 69592db1 parent b5174fa1 file · +10 −6Browse files

Unified · Split

kernel/irq/handle.c+10−6
@@ -54,14 +54,18 @@ static void warn_no_thread(unsigned int irq, struct irqaction *action) · 53 unmodified lines
5454 static void irq_wake_thread(struct irq_desc *desc, struct irqaction *action)
5555 {
5656 /*
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
6166 * RUNTHREAD bit is already set, nothing to do.
6267 */
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))
6569 return;
6670
6771 /*