Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux Hosts
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > GNU Linux Zone > The Linux Kernel
Reload this Page Scheduling question
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

The Linux Kernel Compiling, theory, programming or other discussion about the linux kernel

Reply
 
Thread Tools Display Modes
Old 12-29-2005   #1 (permalink)
addNtoX
Just Joined!
 
Join Date: Dec 2005
Posts: 2
Scheduling question

I recently had to modify the Linux scheduling scheme in one homework assignment, working on kernel version 2.4.18-14 which is identical to the 2.6 kernels in terms of scheduling.

I noticed a weird situation: When processes are moved to the expired queue when they have finished their timeslice, their timeslice for the next epoch is calculated. When I deleted the line that does this, I got a bug where do_fork() was being executed for a task with timeslice=0, which creates some problems for do_fork() and therefor it throws a bug.

How does this make sense? If do_fork() was called from a process, it means it was running, which means it still had a piece of its timeslice left... How does fork get called from a process after it has finsihed its timeslice?
addNtoX is offline   Reply With Quote
Old 12-29-2005   #2 (permalink)
lakerdonald
Linux Guru
 
lakerdonald's Avatar
 
Join Date: Jun 2004
Location: St. Petersburg, FL
Posts: 5,039
May I ask why you deleted the part of the code that recalculates the process's timeslice?
__________________
the lost art of found sound
lakerdonald is offline   Reply With Quote
Old 12-29-2005   #3 (permalink)
addNtoX
Just Joined!
 
Join Date: Dec 2005
Posts: 2
Yeah, of course you may

The assignment was about creating a new scheduling scheme, in which you calculate the timeslice of all proccesses at the begining of an epoch, so that the total timeslices you give out is 150*N (millisecs), where N is the number of tasks in the run queue. There are more requirements of course, but this is the general idea.

Therefor, when an epoch ends I do all the calculations and calculate all the timeslices based on the processes currently in the active queue and there is no need to re-calculate the timeslice of a task after it finishes its timeslice as it will be done when the entire epoch ends and a new one begins.
addNtoX is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT. The time now is 12:26 PM.




© 2000 - 2008 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.0.0