-tip: ACPICA: Do not schedule during early init

From: Ingo Molnar
Date: Sat Jul 11 2009 - 07:29:19 EST



* Peter Zijlstra <a.p.zijlstra@xxxxxxxxx> wrote:

> Matt suggested, whereupon Linus sayeth:
>
> "This looks like a good patch. Please make it so"
>
> Compile and boot tested on x86_64 only.

I wanted to wait with his for .32, but Linus applied it yesterday so
lets hope it's all fine on all architectures ;-)

There's one new test failure on x86 caused by this commit: a
scheduling-while-atomic assert during early ACPI init - fixed by the
patch below. It triggers on two separate test-systems.

Btw., that ACPI_PREEMPTION_POINT() wrapper is both superfluous (we
should not wrap something as obvious as a cond_resched()) and shows
signs of problems:

#define ACPI_PREEMPTION_POINT() \
do { \
if (!irqs_disabled()) \
cond_resched(); \
} while (0)

that should have been 1) an inline function 2) should not check for
whether irqs are off. If we need to check for irqs-off like this
then this is a sign that either the code flow is too unbalanced
(mixing different things into the same function), or that the
preemption point has been applied at a too low level.

So a followup cleanup would likely be in order, especially that this
was the last (and only) call site of ACPI_PREEMPTION_POINT(). I'd
suggest to remove it.

( I'm not sure what prompted the addition of this rescheduling point
- if there was a strong reason for it then we should probably add
back the preemption point to the place that is causing the
latency. )

Ingo

-------------------->