All of lore.kernel.org
 help / color / mirror / Atom feed
From: george anzinger <george@mvista.com>
To: SodaPop <soda@xirr.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [QUESTION] 2.4.x nice level
Date: Mon, 09 Apr 2001 20:37:10 -0700	[thread overview]
Message-ID: <3AD27FE6.4987E792@mvista.com> (raw)
In-Reply-To: <Pine.LNX.4.30.0104041104510.9687-100000@xirr.com>

SodaPop wrote:
> 
> I too have noticed that nicing processes does not work nearly as
> effectively as I'd like it to.  I run on an underpowered machine,
> and have had to stop running things such as seti because it steals too
> much cpu time, even when maximally niced.
> 
> As an example, I can run mpg123 and a kernel build concurrently without
> trouble; but if I add a single maximally niced seti process, mpg123 runs
> out of gas and will start to skip while decoding.
> 
> Is there any way we can make nice levels stronger than they currently are
> in 2.4?  Or is this perhaps a timeslice problem, where once seti gets cpu
> time it runs longer than it should since it makes relatively few system
> calls?
> 
In kernel/sched.c for HZ < 200 an adjustment of nice to tick is set up
to be nice>>2 (i.e. nice /4).  This gives the ratio of nice to time
slice.  Adjustments are made to make the MOST nice yield 1 jiffy, so
using this scale and remembering nice ranges from -19 to 20 the least
nice is 40/4 or 10 ticks.  This implies that if only two tasks are
running and they are most and least niced then one will get 1/11 of the
processor, the other 10/11 (about 10% and 90%).  If one is niced and the
other is not you get 1 and 5 for the time slices or 1/6 and 5/6 (17% and
83%).  

In 2.2.x systems the full range of nice was used one to one to give 1
and 39 or 40 or 2.5% and 97.5% for max nice to min.  For most nice to
normal you would get 1 and 20 or 4.7% and 95.3%.

The comments say the objective is to come up with a time slice of 50ms,
presumably for the normal nice value of zero.  After translating the
range this would be a value of 20 and, yep 20/4 give 5 jiffies or 50
ms.  Sure puts a crimp in the min to max range, however.

George

  reply	other threads:[~2001-04-10  3:38 UTC|newest]

Thread overview: 15+ 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 [this message]
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
     [not found] <fa.j9vo8pv.1rj8up9@ifi.uio.no>
     [not found] ` <fa.dkui9av.1ulsbjm@ifi.uio.no>
2001-04-05 17:24   ` Tor Arntsen
  -- strict thread matches above, loose matches on Subject: below --
2001-04-02 23:04 Quim K Holland
2001-04-03  3:02 ` LA Walsh
2001-04-02 22:13 BERECZ Szabolcs

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=3AD27FE6.4987E792@mvista.com \
    --to=george@mvista.com \
    --cc=linux-kernel@vger.kernel.org \
    --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 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.