From: Nick.Holloway@pyrites.org.uk (Nick Holloway)
To: linux-kernel@vger.kernel.org
Subject: Re: Q: "kapm-idled" and CPU usage
Date: 18 Mar 2001 23:47:40 -0000 [thread overview]
Message-ID: <993hes$2pb$1@alfie.demon.co.uk> (raw)
In-Reply-To: <3AB50177.47489C00@mandrakesoft.com>
jgarzik@mandrakesoft.com (Jeff Garzik) writes:
> Is there some way to hack the scheduler statistics so that idle
> processes are special cases, which do not accumulate CPU time nor
> contribute to the load average?
I wondered about getting kapm-idled to take the CPU time allocated to
itself, and reallocate to the idle task. Something like the following
at a strategic point inside the apm loop.
unsigned long user, system;
user = current->times.tms_utime;
system = current->times.tms_stime;
current->times.tms_utime = current->times.tms_stime = 0;
idle->times.tms_utime += user;
idle->times.tms_stime += system;
I haven't looked to see what point would be a good idea, and investigated
what locks need to be held. I've also just peeked at the 2.4 code,
and seen "current->per_cpu_utime[cpu]" -- does this need handling?
Is it visible to user space?
If you looked closely, you might see the CPU time falling for kapm-idled,
but generally you would see it allocated to the idle task, and not
kapm-idled.
> I agree that it's not pretty to special case idle function process(es),
> but those idle functions in turn are causing an incorrect picture of the
> system state to be presented to userland.
At least with this scheme, the special casing is inside the kapm specific
code, and not within the general timer handling.
Of course, this is no more than an idea. I haven't got as far as
running 2.4 on my only APM machine (486 Thinkpad), let alone trying out
this scheme.
--
`O O' | Nick.Holloway@pyrites.org.uk
// ^ \\ | http://www.pyrites.org.uk/
next prev parent reply other threads:[~2001-03-18 23:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-03-18 18:41 Q: "kapm-idled" and CPU usage Jeff Garzik
2001-03-18 22:03 ` Rik van Riel
2001-03-18 23:47 ` Nick Holloway [this message]
2001-03-21 21:14 ` Alan Cox
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='993hes$2pb$1@alfie.demon.co.uk' \
--to=nick.holloway@pyrites.org.uk \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox