From: george anzinger <george@mvista.com>
To: Rik van Riel <riel@conectiva.com.br>
Cc: Pavel Machek <pavel@suse.cz>, SodaPop <soda@xirr.com>,
alexey@datafoundation.com, linux-kernel@vger.kernel.org
Subject: Re: [test-PATCH] Re: [QUESTION] 2.4.x nice level
Date: Mon, 16 Apr 2001 10:49:44 -0700 [thread overview]
Message-ID: <3ADB30B8.109D48E3@mvista.com> (raw)
In-Reply-To: <Pine.LNX.4.21.0104161118180.14442-100000@imladris.rielhome.conectiva>
Rik van Riel wrote:
>
> On Thu, 12 Apr 2001, Pavel Machek wrote:
>
> > > One rule of optimization is to move any code you can outside the loop.
> > > Why isn't the nice_to_ticks calculation done when nice is changed
> > > instead of EVERY recalc.? I guess another way to ask this is, who needs
> >
> > This way change is localized very nicely, and it is "obviously right".
>
> Except for two obvious things:
>
> 1. we need to load the nice level anyway
> 2. a shift takes less cycles than a load on most
> CPUs
>
Gosh, what am I missing here? I think "top" and "ps" want to see the
"nice" value so it needs to be available and since the NICE_TO_TICK()
function looses information (i.e. is not reversible) we can not compute
it from ticks. Still, yes we need to load something, but is it nice?
Why not the result of the NICE_TO_TICK()?
A shift and a subtract are fast, yes, but this loop runs over all tasks
(not just the run list). This loop can put a real dent in preemption
times AND the notion of turning on interrupts while it is done can run
into some interesting race conditions. (This is why the MontaVista
scheduler does the loop without dropping the lock, AFTER optimizing the
h... out of it.)
What am I missing?
George
prev parent reply other threads:[~2001-04-16 17:52 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-04-04 16:12 [QUESTION] 2.4.x nice level SodaPop
2001-04-10 3:37 ` george anzinger
2001-04-10 16:10 ` Rik van Riel
2001-04-10 16:39 ` george anzinger
2001-04-11 10:34 ` [test-PATCH] " Rik van Riel
2001-04-11 15:53 ` Rik van Riel
2001-04-12 22:51 ` Pozsar Balazs
2001-04-11 16:27 ` george anzinger
2001-04-12 23:51 ` Pavel Machek
2001-04-16 14:18 ` Rik van Riel
2001-04-16 17:49 ` george anzinger [this message]
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=3ADB30B8.109D48E3@mvista.com \
--to=george@mvista.com \
--cc=alexey@datafoundation.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pavel@suse.cz \
--cc=riel@conectiva.com.br \
--cc=soda@xirr.com \
/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