[LITMUS^RT] question about cedf_task_wakeup()

Björn Brandenburg bbb at mpi-sws.org
Tue Jan 22 07:33:11 CET 2013


On Jan 21, 2013, at 7:13 PM, Glenn Elliott <gelliott at cs.unc.edu> wrote:
> 
> I am looking at some code in sched_cedf.c::cedf_task_wakeup().  There is an if-statement that conditionally clears the rt_params 'completed' flag (https://github.com/LITMUS-RT/litmus-rt/blob/master/litmus/sched_cedf.c#L605).
> 
> if (task->rt.time_slice) {
> 	/* came back in time before deadline */
> 	tsk_rt(task)->completed = 0;
> }
> 
> What was the intent of the condition on the value of 'time_slice'?  What do we expect to happen if 'time_slice' is zero?  Can it ever be zero?
> 
> I'm just curious.  I am only wondering if this is dead code.  (In fact, I'm not entirely sure clearing 'completed' is necessary since the 'is_tardy()' condition checked earlier in code, I think, ensures that the waking up task is not starting a new job when 'completed' is cleared, so 'completed' would already have to be false.)

The wake-up handlers in several plugins has seem some bit rot over the years; we'll have to clean them up from scratch eventually. It's not very flexible (the is_tardy() heuristic is not always what you want in cases of bounded tardiness) and contains some oddities such as the one that you pointed out. Patches welcome…

To answer your question, yes, I believe that code serves no useful purpose (anymore). Afaik, the time_slice parameter has not been relevant since the LITMUS^RT versions based on 2.6.20, possibly even earlier.

- Björn





More information about the litmus-dev mailing list