Bill.Holler wrote:
>
> Perhaps acpi_idle could call a policy function which decides
> which idle
> state to enter?
> acpi_idle would then do whichever idle halt it should do.
>
> Something like:
>
> acpi_idle()
> {
> do_idle_preprocessing /* dtrace probes etc */
>
> spin:
> switch (idle_policy())
> case SPIN_IDLE;
> smp_pause()
> goto spin
> break
>
> case HALT_C1:
> halt_idle_c1()
> break
>
> case MWAIT_C1:
> mwait_idle_c1()
> break
>
> case ACPI_C2:
> acpi_idle_c2()
> break
>
> case ACPI_C3:
> acpi_idle_c3()
> break
> }
>
> do_idle_postprocessing(); /* dtrace probes etc */ }
>
>
> This scheme would allow us to plug in whatever policy function we want
> for testing. The policy could be based on time until the next cyclic
> interrupt and hints from the power aware scheduler.
>
> This scheme would also allow us to do adaptive idle on systems
> which have
> a lower latence mwait which uses more power than halt. The processor
> could use mwait if it knew it was going to wake up soon and
> halt if it was
> going to be idle a long time.
>
This one looks pretty good, ;-)
-Aubrey