All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Steinmetz <ast@domdv.de>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: linux-kernel@vger.kernel.org, <dglidden@illusionary.com (Derek Glidden)>
Subject: Re: kapm-idled no longer idling CPU?
Date: Fri, 30 Nov 2001 13:34:03 +0100 (CET)	[thread overview]
Message-ID: <XFMail.20011130133403.ast@domdv.de> (raw)
In-Reply-To: <E169mBE-0003Fw-00@the-village.bc.nu>


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

  reply	other threads:[~2001-11-30 12:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-29 18:58 kapm-idled no longer idling CPU? Derek Glidden
2001-11-30 11:50 ` Alan Cox
2001-11-30 12:34   ` Andreas Steinmetz [this message]
2001-11-30 13:23     ` Alan Cox
2001-11-30 15:46       ` Andreas Steinmetz
2001-12-03  7:03 ` Tim Connors
  -- strict thread matches above, loose matches on Subject: below --
2001-11-30 12:57 Borsenkow Andrej

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=XFMail.20011130133403.ast@domdv.de \
    --to=ast@domdv.de \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=dglidden@illusionary.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.