Re: irq lock inversion

From: Tejun Heo
Date: Fri Nov 06 2009 - 03:53:23 EST


Ingo Molnar wrote:
> My question is, why do we do flags save/restore in pcpu-alloc?

That's strictly for calls from sched_init().

> Do we ever call it with irqs disabled? If yes, then the vfree might
> be unsafe due to vfree() potentially flushing TLBs (on all CPUs) and
> that act of sending IPIs requiring irqs to be enabled.

And when called from sched_init(), it won't call vfree().

> ( Now, Nick has optimized vfree recently to lazy-free areas, but that
> was a statistical optimization: TLB flushes are still possible, just
> done more rarely. So we might end up calling flush_tlb_kernel_range()
> from vfree(). I've Cc:-ed Nick. )

Nevertheless, it would be nice to allow at least the free part to be
called from irqsafe context. vmalloc is doing a lot of things lazily
so deferring TLB flushes to a work wouldn't make much difference, I
suppose?

Thanks.

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