0

I was working on the Linux CFS scheduler and came across this tuneable parameter called sched_wakeup_granularity_ns. The use of this goes as follows as described in this paper.

This parameter controls the wake-up latency of a task, i.e., the amount of time it must lapse before it can preempt the current task.

Further looking up on this parameter from here :

If the difference between the virtual run time of current running process and the virtual run time of preempting process is bigger than the virtual run time of sched_wakeup_granularity_ns (here, transfer sched_wakeup_granularity_ns to a virtual run time with preempting process’s weight), the preemption happens.

The default value of this in my system is 2.5 milli seconds.

My question : If a process with a deadline <= 2.5 ms comes at time another low priority process is executing then, it won't get its chance to execute because of this minimum granularity and will always miss its deadline.

Am I right in my claim ? Why is the Linux kernel designed like that ?

Of course we can set this parameter to 0 ms and re-compile the kernel, but don't tasks with deadlines of 2.5 ms occur frequently in day to day life ? Video decoders, sound processing apps, and other latency critical workloads ?

Rohith R
  • 1,309
  • 2
  • 17
  • 36
  • FYI, this question was also [**asked on the kernel newbies mailing list**](https://www.spinics.net/lists/newbies/msg59452.html) and a brief technical discussion ensued. – TheCodeArtist Jan 10 '18 at 08:23
  • Yea. that's me only who asked the question :p – Rohith R Jan 10 '18 at 08:24
  • Oh okay :) :) When you get some time, can you summarise the conclusion from the email-discussion as an answer here and mark it accepted for now? Also it would be useful to include for future reference what worked for you i.e. how you ended-up solving the original problem you had. – TheCodeArtist Jan 10 '18 at 11:14

0 Answers0