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

  • Home
  • SEARCH
  • 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 6384565
In Process

The Archive Base Latest Questions

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

I am new to linux kernel and low level programming. I wanted to know

  • 0

I am new to linux kernel and low level programming. I wanted to know how linux scheduler is supposed to be O(1) in time complexity.

I came across the following article which is very informative but I have a problem understanding the pargraph I have reproduced below
http://www.ibm.com/developerworks/linux/library/l-scheduler/

The job of the scheduler is simple: choose the task on the highest
priority list to execute. To make this process more efficient, a
bitmap is used to define when tasks are on a given priority list.
Therefore, on most architectures, a find-first-bit-set instruction is
used to find the highest priority bit set in one of five 32-bit words
(for the 140 priorities). The time it takes to find a task to execute
depends not on the number of active tasks but instead on the number of
priorities. This makes the 2.6 scheduler an O(1) process because the
time to schedule is both fixed and deterministic regardless of the
number of active tasks.

Why 5 words of 32 bits for 140 queues ? Who the find-first-bit-set instruction helps to select one of the 140 queues ?

  • 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-25T02:47:29+00:00Added an answer on May 25, 2026 at 2:47 am

    A bit field uses a single value to represent a number of boolean states, for example if we were using an 8 bit integer then we might say that:

    17 (decimal) = 00010001 (binary)
    

    Which would indicates that the 4th and 8th boolean values are true, where all other boolean values are false. In total 8 boolean states can be tracked as there are 8 bits.

    As we wish to track 140 states (1 for each queue, true indicating that queue contains a task), 140 bits are required, and so as 140 / 32 = 4.375, we need at least 5 32 bit integers to store all boolean states.

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

Sidebar

Related Questions

I am new to Linux system programming and I came across API and ABI
New to Linux programming in general. I am trying to communicate with a kernel
I'm pretty new to programming for Linux environments, so I don't exactly know what
I am a new comer to Linux Kernel Module programming. From the material that
I'm writing a new syscall inside the linux kernel. I want to implement an
I'm new to linux kernel and could barely understand how to debug kernel panics.
First off i'm new to Linux programming so apologies if this makes no sense
I am quite new to the embedded linux programming and did not really understand
I am new to Linux Kernel. I am reading this informative article that says
I am new to linux kernel. And recently, i've went through the sendfile syscall

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.