Re: [RFC][PATCH] making vfree() safe from interrupt contexts

From: Linus Torvalds
Date: Sun Mar 03 2013 - 17:34:06 EST


On Sun, Mar 3, 2013 at 10:47 AM, Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote:
> To bring back the thing discussed back in, IIRC, December: we have
> a bunch of places where inability to do vfree() from interrupt contexts
> (the most common case is doing that from RCU callback) leads to very
> ugly open-coded schemes that delay it one way or another. We can let vfree()
> itself do that instead. AFAICS, it works; the diff below covers several
> obvious cases found just by grep. I'm fairly sure that there's more code
> that could benefit from that...

I have nothing against the patch, but I hate seeing it just before I
am getting ready to close the merge window.

And I'm not willing to apply it, since I think it's buggy: the whole
point of deferred_vfree() is that it is for irq context, yet it's not
using an irq-safe lock. So nested interrupts can deadlock.

So I think the concept is fine, the patch is probably fine after just
changing the spinlock to be irq-safe, but the timing is horrible. It
doesn't seem to be *that* urgent, so maybe you could just put it in
your queue for 3.10 after fixing the irq locking?

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