Re: [RFC] genirq: Flush the irq thread on synchronization

From: Thomas Gleixner
Date: Tue Dec 06 2011 - 19:48:33 EST


On Wed, 7 Dec 2011, Ido Yariv wrote:

> Hi Thomas,
>
> On Mon, Dec 05, 2011 at 10:55:01PM +0100, Thomas Gleixner wrote:
> > Does the following (untested) patch solve your issues?
>
> I briefly tested this patch and it appears to also solve the issues I
> mentioned.
>
> I think both solutions would work. The only drawbacks I see in using
> this patch over the other one are that this patch involves a bit more
> locking in synchronize_irq() and irq_finalize_oneshot() (for non-oneshot
> irqs), and that the oneshot mechanism is used for non-oneshot threads.

I don't care about synchronize_irq() at all. It's a slow path anyway.

The extra burden in irq_finalize_oneshot() is somewhat of a concern,
but that locks should be completely uncontended for real threaded irq
users, so in practice it's a non issue.

It's the only solution which actually solves the thread_active leak,
though I just discovered a very narrow race window between the
test_and_clear_bit and the active increment, which is easy to
fix. I'll send out another version tomorrow

Thanks,

tglx
--
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/