Re: [PATCH 5/5] irq: move irq_desc according to smp_affinity v5

From: Ingo Molnar
Date: Mon Dec 08 2008 - 08:42:46 EST



* Yinghai Lu <yinghai@xxxxxxxxxx> wrote:

> +#ifdef CONFIG_MOVE_IRQ_DESC
> + /* get new one */
> + desc = irq_to_desc(irq);
> +#endif
>
> spin_unlock(&desc->lock);
> }
> @@ -467,12 +475,20 @@ handle_edge_irq(unsigned int irq, struct
> !desc->action)) {
> desc->status |= (IRQ_PENDING | IRQ_MASKED);
> mask_ack_irq(desc, irq);
> +#ifdef CONFIG_MOVE_IRQ_DESC
> + /* get new one */
> + desc = irq_to_desc(irq);
> +#endif
> goto out_unlock;
> }
> kstat_incr_irqs_this_cpu(irq, desc);
>
> /* Start handling the irq */
> desc->chip->ack(irq);
> +#ifdef CONFIG_MOVE_IRQ_DESC
> + /* get new one */
> + desc = irq_to_desc(irq);
> +#endif
>
> /* Mark the IRQ currently in progress.*/
> desc->status |= IRQ_INPROGRESS;
> @@ -533,8 +549,13 @@ handle_percpu_irq(unsigned int irq, stru
> if (!noirqdebug)
> note_interrupt(irq, desc, action_ret);
>
> - if (desc->chip->eoi)
> + if (desc->chip->eoi) {
> desc->chip->eoi(irq);
> +#ifdef CONFIG_MOVE_IRQ_DESC
> + /* get new one */
> + desc = irq_to_desc(irq);
> +#endif
> + }
> }
>
> void
> @@ -569,8 +590,13 @@ __set_irq_handler(unsigned int irq, irq_
>
> /* Uninstall? */
> if (handle == handle_bad_irq) {
> - if (desc->chip != &no_irq_chip)
> + if (desc->chip != &no_irq_chip) {
> mask_ack_irq(desc, irq);
> +#ifdef CONFIG_MOVE_IRQ_DESC
> + /* get new one */
> + desc = irq_to_desc(irq);
> +#endif

this patch adds a ton of #ifdefs to important .c files, which could all
have been avoided by introducing a new method:

desc = irq_remap_to_desc(irq, desc);

which would do something like:

static struct irq_desc *
irq_remap_to_desc(unsigned int irq, struct irq_desc *desc)
{
#ifdef CONFIG_MOVE_IRQ_DESC
return irq_to_desc(irq);
#else
return desc;
#endif
}

right?

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/