1

I am understanding the implementation of CFS in the Linux kernel. My doubt is when the CFS calculates the ideal time for each task in a given epoch and a ideal time of a task is lower than min_granularity. What place in the code can I find the checking this scenario?

Assume the target latency is 6 miliseconds (ms) and the miminum granularity is 0.75 ms (this is default values) and two runnable tasks. One of them (task 0) has a nice -20 (weight 88761) and other (task 1) has a nice 0 (weight 1024).

The ideal time of task 0 is 5.93 ms ((88761/(88761+1024))*6) and the ideal time of task 1 is 0.068 ms ((1024/(88761+1024))*6). The calculation is done by the function *check_preempt_tick* in each interrupt tick.

The ideal time of task 1 is lower than min_granularity. If CFS assigns min_granularity to task 1, the target latency is larger than 6 ms. Do you know how to work CFS in this situation?

Thanks in advance

Carlos
  • 11
  • 2
  • This? http://lxr.free-electrons.com/source/kernel/sched/fair.c#L1889 – Peter L. Sep 06 '13 at 17:21
  • This function, the CFS checks if the current task on CPU has to be preempted, but the CFS does not check if the time slice of a task is lower than min_granularity. – Carlos Sep 09 '13 at 08:19

0 Answers0