Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7447021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T12:29:25+00:00 2026-05-29T12:29:25+00:00

I am a beginner to the Linux Kernel and I am trying to learn

  • 0

I am a beginner to the Linux Kernel and I am trying to learn how Linux schedules processes.

I have read some books on the Linux Kernel and gone through the links from IBM http://www.ibm.com/developerworks/linux/library/l-cfs/ and all, but I am still left with some doubts.

  1. How does the scheduler schedule all of the tasks within the sysctl_sched_latency time?
  2. When a process wakes up what actually is done in the place_entity function?
  3. When a process wakes up why is the vruntime adjusted by subtracting from sched_latency? Can’t that lead to processes in the run queue with large differences in the vruntime value?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T12:29:26+00:00Added an answer on May 29, 2026 at 12:29 pm

    Firstly the virtual runtime of a task

    • in theory is the when the task would start its next time slice of
      execution on a theoretically perfect multiple threaded CPU.
    • in practice is its actual runtime normalized to the total number of running tasks

    1. How does the scheduler schedule all of the tasks within the
    sysctl_sched_latency time?

    It maintains a time ordered red and black tree, where all the runnable tasks are
    sorted by their virtual runtime. Nodes on the left have run for the shortest amount of time.
    CFS picks the left most task and runs it, until the task schedules or the scheduler ticks
    then the CPU time it spent running is added to its virtual runtime.
    When it is no longer the left most node, then new task with the shortest virtual is run and
    the old task prempted.

    2. When a process wakes up what actually is done in the place_entity function?

    Short version:

    When a process wakes up the place_entity function either leaves the
    task’s virtual runtime as it was or increases it.

    Long version:

    When a process wakes up the place_entity function does the following things

    1. Initialise the temporary virtual runtime to the CFS run queue’s virtual runtime of the smallest task.

    2. As sleeps less than a single latency don’t count,
      initializses a threshold variable to sysctl_sched_latency.
      If the GENTLE_FAIR_SLEEPERS feature is enabled,
      then half the value of the this variable.
      Decrement the previously initialised temporary virtual runtime by this threshold value.

    3. Ensure that the temporary virtual runtime is at least equal to the task’s virtual runtime, by setting the calculated virtual runtime to the maximum of itself and the task’s virtual runtime.

    4. Set the task’s virtual runtime to the temporary runtime.

    3. When a process wakes up why is the vruntime adjusted by subtracting from sched_latency?

    The virtual runtime is decremented because sleeps less than a single latency don’t count.
    E.g the task shouldn’t have its position changed in the red black tree changed if it has
    only slept for a single scheduler latency.

    4. Can’t that lead to processes in the run queue with large differences in the vruntime value?

    I believe that the logic described in Step 3 for Question 2, prevents or at least minimises that.

    References

    sched Linux Kernel Source

    sched_fair.c Linux Kernel Source

    Notes on the CFS Scheduler Design

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am a beginner. I want to use pyopengl in linux but I have
I am a beginner in using Linux, I have an input file with content
Beginner level question Scenario: Have simple string cocantation tool, that I might expand later
Absolute beginner question: I have a template file index.html that looks like this: ...
I am a complete beginner trying to develop for FCKeditor so please bear with
As a complete beginner with no programming experience, I am trying to find beautiful
Beginner programmer here....hope it makes sense :) I have created a console app that
I want to learn Java and Linux. Java itself (as a language) is not
(Beginner to HTML) I have made a Photoshop mock-up of the website I want
Beginner at Django here, I've been trying to fix this for a long time

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.