Find the answer to your Linux question:
Results 1 to 3 of 3
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    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?

  2. #2
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    Location
    St. Petersburg, FL
    Posts
    5,035
    May I ask why you deleted the part of the code that recalculates the process's timeslice?

  3. #3
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •