CS FundamentalsVery hardGATE CS

Linux's CFS gives each runnable task a virtual runtime that increases more slowly for higher-weight (lower nice) tasks, and always runs the task with the smallest virtual runtime. Two CPU-bound tasks have weights 1024 (nice 0) and 335 (nice 5). About what share of the CPU does the nice-0 task receive?

  1. A. About 50%
  2. B. About 90%
  3. C. About 25%
  4. D. About 75%

Correct answer: D. About 75%

CFS shares the CPU in proportion to weight: 1024 / (1024 + 335) ≈ 0.753, so roughly three quarters. Each nice level changes weight by about 1.25×, so 5 levels is about 3×.

More Operating Systems questions

Exams that ask this topic