LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-02-2006, 03:19 AM   #1
cathiejcm
LQ Newbie
 
Registered: Nov 2005
Posts: 5

Rep: Reputation: 0
Talking linux - scheduling policies


hey.. anybody..need help..

is Linux using multilevel queues for its CPU scheduling?
why are there two policies for its real-time processes(FIFO and RR)? how are these policies assigned to the processes?

tnx
 
Old 01-02-2006, 02:48 PM   #2
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
on my 2.6.8.1 system there is one runqueue for each CPU
Each runqueue contains two priority arrays active and expired and a data structure for info about the threads.
When a task runs out of timeslice, it is removed from the active priority
array and put into the expired priority array and new timeslices are recalculated individually then. when the active array is empty the pointer to the two arrays is switched.
Priority arrays are an array of linked lists, one for each 140 priority levels.
if multiple tasks exit at the same priority level, they are scheduled
round-robin against each other.after running, tasks are put at the bottom of their priority level’s list.
RT tasks have priorities from 0 to 99 while non-RT task priorities map onto 100+
RT tasks operate like you said under these two different scheduling schemes.
non-RT tasks are SCHED_NORMAL
SCHED_FIFO is the strongest of all RT task -- it has no timeslice and higher priority SCHED_FIFO tasks will preempt lower. SCHED_FIFO tasks are not preemptable by anything else. They just run. firt in first out.
SCHED_RR (round robin) within a certain priority range they are scheduled using round robin. they have a timeslices and are always preempted by SCHED_FIFO. when their timeslice is done they go to the bottom of their priority array.
Quote:
how are these policies assigned to the processes?
well you define a RT_TASK structure
fifo is created with rtf_create() rtf_create_handler() rtf_get()
and like that
FIFO really is a pipe to a /dev/rtf0 and like that
otherwise i think it's scheduled RR

Last edited by foo_bar_foo; 01-02-2006 at 02:50 PM.
 
Old 01-02-2006, 02:57 PM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939
In the /usr/src/linux/Documentation directory of the Linux source, you'll find a fairly detailed explanation of the scheduler. You can study that scheduler at your leisure at /usr/src/linux/kernel/sched.c.

Operating systems normally have to deal with two kinds of processor scheduling requirements: those where a certain latency must be guaranteed; and the vast majority of others, which do not.

For example, the computer that controls Superman's hands must be able to respond within an extremely short period (short latency) to the puff of flame from Evil Lex Luthor's Cosmic Zap-Em Gun, in time to swat the bullet out of the air.
 
Old 01-14-2006, 07:59 AM   #4
cathiejcm
LQ Newbie
 
Registered: Nov 2005
Posts: 5

Original Poster
Rep: Reputation: 0
ok..so basically processes are chosen by their priorities.

but i've read that SCHED_RR tasks are preempted by SCHED_FIFO tasks.

what happens when a SCHED_RR task with a higher priority than a SCHED_FIFO task in the runqueue arrives?is the SCHED_FIFO task preempted? which one gets the CPU?

i'm kinda confused which first to consider. the priority of a RT process or its sched policy?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How could I create policies for a Linux LDAP authenticating for Windows clients? HGeneAnthony Linux - General 1 01-26-2007 08:02 AM
Linux 4 auth/XP policies/file sharing ipstacks Linux - Enterprise 1 10-12-2005 10:21 PM
Scheduling in Linux asurya Linux - General 5 08-31-2005 08:34 AM
Linux Scheduling Kumar Programming 3 06-14-2004 04:24 AM
How can apply group policies on windows clients from Linux Server linuxeagle Linux - Networking 5 11-17-2003 10:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration