[LITMUS^RT] running a task as its execution time

Björn Brandenburg bbb at mpi-sws.org
Thu Feb 21 13:31:33 CET 2013


On Feb 20, 2013, at 11:00 PM, Jonathan Herman <hermanjl at cs.unc.edu> wrote:

> I've noticed a very rare bug caused by this patch. A simplified explanation of what happens:
> 
> CPU 1 Job A completes execution in userspace.
> CPU 2 Job A is preempted, and requeued ON THE RELEASE QUEUE.
> CPU 1 Job A has complete_job() called in the ensuing call to schedule().
> CPU 1 Job A is removed() from the ready queue under if(is_queued(t)) unlink(). Because Job A is in the release queue, and not the ready queue, the system crashes.
> 
> I was only able to create this pattern of execution on the first job after a synchronous release with CONFIGS_SCHED_CPU_AFFINITY set. I don't know why. I've pushed another patch, prop/budget-bug-fix-fix, to github which prevents requeues while a task's completed flag is set.
> 
> commit eb3ec58872e6ca6074b67d55f1e3ca363499d6af
> Author: Jonathan Herman <hermanjl at cs.unc.edu>
> Date:   Wed Feb 20 16:58:50 2013 -0500
> 
>     Don't requeue jobs which have their completed flag set.
> 
> diff --git a/include/litmus/budget.h b/include/litmus/budget.h
> index 33344ee..59e9869 100644
> --- a/include/litmus/budget.h
> +++ b/include/litmus/budget.h
> @@ -29,7 +29,7 @@ static inline int requeue_preempted_job(struct task_struct* t)
>         /* Add task to ready queue only if not subject to budget enforcement or
>          * if the job has budget remaining. t may be NULL.
>          */
> -       return t && (!budget_exhausted(t) || !budget_enforced(t));
> +       return t && (!budget_exhausted(t) || !budget_enforced(t)) && !is_completed(t);
>  }
>  
>  #endif


Just wondering: is this the same issue that Glenn reported, and for which I posted a potential C-EDF-specific patch a couple of weeks ago?

- Björn





More information about the litmus-dev mailing list