<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hello All,<div><br></div><div>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 (<a href="https://github.com/LITMUS-RT/litmus-rt/blob/master/litmus/sched_cedf.c#L605">https://github.com/LITMUS-RT/litmus-rt/blob/master/litmus/sched_cedf.c#L605</a>).</div><div><br></div><div><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; border: 0px; font-size: 12px; font-family: Consolas, 'Liberation Mono', Courier, monospace; color: rgb(51, 51, 51); line-height: 16px; "><div class="line" id="LC605" style="margin: 0px; padding: 0px 0px 0px 10px; border: 0px; "><span class="k" style="margin: 0px; padding: 0px; border: 0px; font-weight: bold; ">if</span> <span class="p" style="margin: 0px; padding: 0px; border: 0px; ">(</span><span class="n" style="margin: 0px; padding: 0px; border: 0px; ">task</span><span class="o" style="margin: 0px; padding: 0px; border: 0px; font-weight: bold; ">-></span><span class="n" style="margin: 0px; padding: 0px; border: 0px; ">rt</span><span class="p" style="margin: 0px; padding: 0px; border: 0px; ">.</span><span class="n" style="margin: 0px; padding: 0px; border: 0px; ">time_slice</span><span class="p" style="margin: 0px; padding: 0px; border: 0px; ">)</span> <span class="p" style="margin: 0px; padding: 0px; border: 0px; ">{</span></div><div class="line" id="LC606" style="margin: 0px; padding: 0px 0px 0px 10px; border: 0px; "><span class="cm" style="margin: 0px; padding: 0px; border: 0px; color: rgb(153, 153, 136); font-style: italic; "><span class="Apple-tab-span" style="white-space:pre">   </span>/* came back in time before deadline </span><span style="color: rgb(153, 153, 136); font-style: italic; ">*/</span></div><div class="line" id="LC608" style="margin: 0px; padding: 0px 0px 0px 10px; border: 0px; "> <span class="n" style="margin: 0px; padding: 0px; border: 0px; ">tsk_rt</span><span class="p" style="margin: 0px; padding: 0px; border: 0px; ">(</span><span class="n" style="margin: 0px; padding: 0px; border: 0px; ">task</span><span class="p" style="margin: 0px; padding: 0px; border: 0px; ">)</span><span class="o" style="margin: 0px; padding: 0px; border: 0px; font-weight: bold; ">-></span><span class="n" style="margin: 0px; padding: 0px; border: 0px; ">completed</span> <span class="o" style="margin: 0px; padding: 0px; border: 0px; font-weight: bold; ">=</span> <span class="mi" style="margin: 0px; padding: 0px; border: 0px; color: rgb(0, 153, 153); ">0</span><span class="p" style="margin: 0px; padding: 0px; border: 0px; ">;</span></div><div class="line" id="LC609" style="margin: 0px; padding: 0px 0px 0px 10px; border: 0px; "><span class="p" style="margin: 0px; padding: 0px; border: 0px; ">}</span></div></pre><div><br></div></div><div>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?</div><div><br></div><div>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.)</div><div><br></div><div>-Glenn</div></body></html>