Re: kapm-idled no longer idling CPU?

From: Andreas Steinmetz (ast@domdv.de)
Date: Fri Nov 30 2001 - 07:34:03 EST


On 30-Nov-2001 Alan Cox wrote:
>> application that uses more than very minor system resources is running,
>> (i.e. mozilla, netscape, xemacs, apache, Tomcat, just to name a few
>> common ones I've seen this behaviour with) kapm-idled no longer receives
>> scheduling time from what I can tell and I assume that means my CPU is
>> never getting idled when nothing is scheduled.
>
> kapm_idled will get scheduling time when there is nothing else to run,
> whether it wants it or is using it is more of the question.
>

Well, that's exactly the problem. in apm_mainloop the following happens:

                timeout = 2 * timeout;
                if (timeout > APM_CHECK_TIMEOUT)
                        timeout = APM_CHECK_TIMEOUT;
                schedule_timeout(timeout);

...

                if (!system_idle())
                        continue;

...

if (apm_do_idle() != -1) {

...

                        timeout = 1;
                }

This just means that after a busy condition we start at 1 and increase the
scheduling delay until the timeout reaches HZ.

system_idle itself just checks, if nr_running is 1. This means that if any
single other process is runnable every HZ time when apm_idled checks the system
state it won't switch to idle state even if the system is otherwise idle. I do
see this behaviour e.g. all the time with KDE.

Just create a process that does a select timeout every HZ and down the drain
goes your laptop battery, when the select call meets kapm-idled polling time.

Andreas Steinmetz
D.O.M. Datenverarbeitung GmbH
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Nov 30 2001 - 21:00:38 EST