From: "Chris Friesen" <cfriesen@nortel.com>
To: Daniel Rodrick <daniel.rodrick@gmail.com>
Cc: Linux Newbie <linux-newbie@vger.kernel.org>,
Kernel Newbies <kernelnewbies@nl.linux.org>,
linux-kernel@vger.kernel.org
Subject: Re: Questions about linux scheduler
Date: Thu, 29 Oct 2009 13:58:10 -0600 [thread overview]
Message-ID: <4AE9F3D2.8030502@nortel.com> (raw)
In-Reply-To: <292693080910290808x69f25f6fgc49cb646c1c00466@mail.gmail.com>
On 10/29/2009 09:08 AM, Daniel Rodrick wrote:
> Hi list,
>
> I'm following the Robert Love's book and am trying to understand the
> Linux O(1) scheduler.
The details of Rob Love's book are now out of date and no longer
applicable to the current scheduler. Some of the overall concepts are
still applicable though.
> So here is my understanding. The kernel allows
> the applications to specify two types of priorities
>
> * Realtime Priorities: Range from 0 to 99
Actually, 1 to 99.
> * Non-realtime priorities: Also called "nice" values range from -20 to +19.
>
> (The above are mutually exclusive)
Correct.
> Over all Scheduling algo
> =================
> * A total of 140 priorities (100 RT + 40 non-RT) - these priorities
> are static - do not change over time.
So far so good.
> * A lower priority process will run only if there are no runnable
> processes in priority above it - this automatically means that all RT
> processes get to run before non-RT processes.
True for RT, not true for non-RT. In the current scheduler the non-RT
tasks are stored in a time-ordered structure rather than the 40
runqueues that were used before. A non-RT task will run once it becomes
the most "urgent" task based on its nice level, how much cpu time it
uses, and how long it's been since it ran last relative to other tasks
on the system.
> * tasks on the same priority level are scheduled round robin
True for RT. For non-RT, tasks of other nice levels may be interleaved
depending on how much cpu time they've been using.
> Is my above understanding correct? Where my understanding doesn't fit
> is the conncept of dynamic timeslice calculation. IMHO, the dynamic
> timeslice calculation applies only to Non-RT processes, right? Because
> a higher priority RT process should always get to run.
With the new scheduler I think it's fair to say that non-RT tasks don't
really have a fixed "timeslice". The amount of time they get to run is
determined by their nice level, previous cpu usage, cpu usage of other
tasks, etc.
Chris
next prev parent reply other threads:[~2009-10-29 20:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-29 15:08 Daniel Rodrick
2009-10-29 19:58 ` Chris Friesen [this message]
2009-10-30 10:20 ` Daniel Rodrick
2009-10-30 15:55 ` Mulyadi Santosa
2009-10-29 20:05 ` Jonathan Corbet
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=4AE9F3D2.8030502@nortel.com \
--to=cfriesen@nortel.com \
--cc=daniel.rodrick@gmail.com \
--cc=kernelnewbies@nl.linux.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-newbie@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
all inboxes | Powered by JetHome®