http://bugzilla.kernel.org/show_bug.cgi?id=6519





------- Additional Comments From [EMAIL PROTECTED]  2006-05-15 13:39 -------


On Mon, 15 May 2006, Andrew Morton wrote:

> Linus Torvalds <[EMAIL PROTECTED]> wrote:
> >
> > Btw, I think we can close this report, aside from the question about why 
> > that "no-hlt" was there in the first place. I bet the power usage will go 
> > back to where it was with ACPI without that thing.
> 
> Thanks, Linus.
> 
> But..  Was Dave using no-hlt on earlier kernels?  If so, why didn't they
> get hot as well?

Exactly because ACPI _ignored_ that option, so it would use the broken 
ACPI C1 sleepstate.

So ACPI just does:

                /*
                 * Invoke C1.
                 * Use the appropriate idle routine, the one that would
                 * be used without acpi C-states.
                 */ 
                if (pm_idle_save)
                        pm_idle_save();
                else
                        acpi_safe_halt();

where acpi_safe_halt() just does

        static void acpi_safe_halt(void)
        {
                clear_thread_flag(TIF_POLLING_NRFLAG);
                smp_mb__after_clear_bit();
                if (!need_resched())
                        safe_halt();
                set_thread_flag(TIF_POLLING_NRFLAG);
        }        

and here probably pm_idle_save was NULL.

In contrast, the main CPU idle wil do

                        ...
                        idle = pm_idle;

                        if (!idle)
                                idle = default_idle;

                        if (cpu_is_offline(cpu))
                                play_dead();

                        __get_cpu_var(irq_stat).idle_timestamp = jiffies;
                        idle();
                        ...

ie if pm_idle is NULL (which is tha ACPI "saved_pm_idle") it will use 
default_idle, which in turn does

        if (!hlt_counter && boot_cpu_data.hlt_works_ok) {
                clear_thread_flag(TIF_POLLING_NRFLAG);
                smp_mb__after_clear_bit();
                while (!need_resched()) {
                        local_irq_disable();
                        if (!need_resched())
                                safe_halt();
                        else
                                local_irq_enable();
                }
                set_thread_flag(TIF_POLLING_NRFLAG);
        } else {
                while (!need_resched())
                        cpu_relax();
        }

ie it _honors_ that hlt_works_ok flag, unlike the ACPI one.

Now, I'm not saying that ACPI should honor the hlt_works_ok flag, because 
ACPI wouldn't _exist_ on the kind of old machines hat needed it, but I 
think it explains why ACPI ended up running in a cooler C1 than the normal 
idle routine, which would just end up doing that endless loop of 
"cpu_relax()" (which is not a halt, but a special no-op).

                Linus



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
acpi-bugzilla mailing list
acpi-bugzilla@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/acpi-bugzilla

Reply via email to