From: Jonathan Corbet <corbet@lwn.net>
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 14:05:42 -0600 [thread overview]
Message-ID: <20091029140542.21970ff2@bike.lwn.net> (raw)
In-Reply-To: <292693080910290808x69f25f6fgc49cb646c1c00466@mail.gmail.com>
Hi, Daniel,
I'm not a scheduler expert by any stretch, but I can try to play one on
the net...
> I'm following the Robert Love's book and am trying to understand the
> Linux O(1) scheduler.
Note that the O(1) scheduler is no more; it was replaced by the
completely fair scheduler in 2.6.23. For the purposes of your
questions things haven't changed a lot, but it's completely different
internally.
> So here is my understanding. The kernel allows
> the applications to specify two types of priorities
>
> * Realtime Priorities: Range from 0 to 99
> * Non-realtime priorities: Also called "nice" values range from -20 to +19.
You're really talking about different scheduling classes. There are
two realtime classes (FIFO and RR), both of which trump the interactive
class (SCHED_OTHER).
> * A total of 140 priorities (100 RT + 40 non-RT) - these priorities
> are static - do not change over time.
Sort of, but realtime priorities are really an entirely different scale.
> * 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.
That is true for the realtime classes. SCHED_OTHER will give
lower-priority processes a bit of time even in the presence of runnable
high-priority processes.
> * tasks on the same priority level are scheduled round robin
SCHED_RR does that, SCHED_FIFO does not. SCHED_OTHER is
fairness-based, which has RR-like characteristics but is not quite the
same.
Hope that helps,
jon
Jonathan Corbet / LWN.net / corbet@lwn.net
prev parent reply other threads:[~2009-10-29 20:05 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
2009-10-30 10:20 ` Daniel Rodrick
2009-10-30 15:55 ` Mulyadi Santosa
2009-10-29 20:05 ` Jonathan Corbet [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=20091029140542.21970ff2@bike.lwn.net \
--to=corbet@lwn.net \
--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®