public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Con Kolivas <kernel@kolivas.org>
To: Bernardo Innocenti <bernie@develer.com>
Cc: Arjan van de Ven <arjanv@redhat.com>,
	Development discussions related to Fedora Core 
	<fedora-devel-list@redhat.com>,
	Nalin Dahyabhai <nalin@redhat.com>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: RFA: Changing scheduler quantum (Was: REQUEST: OpenLDAP 2.3.7)
Date: Sun, 18 Sep 2005 21:44:50 +1000	[thread overview]
Message-ID: <200509182144.50571.kernel@kolivas.org> (raw)
In-Reply-To: <432D517F.2000604@develer.com>

On Sun, 18 Sep 2005 21:37, Bernardo Innocenti wrote:
> Arjan van de Ven wrote:
> > On Sun, Sep 18, 2005 at 04:27:38AM +0200, Bernardo Innocenti wrote:
> >>It's more meaningful to interpret sched_yield() as "give up the
> >> processor, as if the scheduler quantum had expired".
> >
> > afaik this is *exactly* what the new sched_yield() does ;)
>
> Oops :-)
>
> >>The scheduler wouldn't normally allow a lower priority process to
> >>preempt a high-priority ready process for 30+ ms.  Unless I'm
> >>mistaken about Linux's scheduling policy...
> >
> > if your quantum is up... all other tasks get theirs of course
>
> I assumed dynamic priorities affected the length of the
> quantum, but maybe it just changes the number of times
> the process is scheduled wrt other processes, with the
> quantum being fixed at 20-30ms.
>
> (...a few seconds later...)
>
> Skimming through sched.c, it seems my first guess was
> right: the quantum varies with the priority from 5ms
> to 800ms.
>
> The DEF_TIMESLICE of 400ms looks a bit too gross for
> most applications and the maximum 800ms is just
> ridicolously high.
>
> IIRC, the 7.14MHz 68000 in the Amiga 500 did task-switching
> at 20ms intervals, with a negligible performance hit.
> Couldn't do much better on today's CPUs?

Not quite.

The default timeslice of nice 0 tasks is 100ms. The timeslice is not altered 
the way you have read sched.c. It is altered thus:
1. For 'nice' levels it varies from 5ms at nice 19 to 800ms at nice -20.
2. For interactive tasks, it is cut up into smaller pieces down to 10ms and 
round robins with other tasks at the same dynamic priority, but still is 
based on the nice levels for the full length of cpu time before expiration 
overall.

Cheers,
Con

  reply	other threads:[~2005-09-18 11:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <432B9F4A.6070805@develer.com>
     [not found] ` <1126982265.3010.12.camel@localhost.localdomain>
     [not found]   ` <432CBABC.8090906@develer.com>
     [not found]     ` <20050918013247.GA31974@devserv.devel.redhat.com>
     [not found]       ` <432CD09A.2060201@develer.com>
     [not found]         ` <20050918110524.GA23910@devserv.devel.redhat.com>
2005-09-18 11:37           ` RFA: Changing scheduler quantum (Was: REQUEST: OpenLDAP 2.3.7) Bernardo Innocenti
2005-09-18 11:44             ` Con Kolivas [this message]
2005-09-18 21:53               ` Bernardo Innocenti
2005-09-19  0:46                 ` Con Kolivas

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=200509182144.50571.kernel@kolivas.org \
    --to=kernel@kolivas.org \
    --cc=arjanv@redhat.com \
    --cc=bernie@develer.com \
    --cc=fedora-devel-list@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nalin@redhat.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