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

Jonathan Herman hermanjl at cs.unc.edu
Wed Feb 20 23:00:19 CET 2013


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



On Fri, Jun 15, 2012 at 4:28 AM, Björn Brandenburg <bbb at mpi-sws.org> wrote:

>
> On Jun 14, 2012, at 5:21 PM, Giovani Gracioli wrote:
>
> >
> > just recompiled the kernel with the modifications and the bug is fixed.
>
> Excellent, thanks for confirming this. I'll merge the patch into staging.
>
> - Björn
>
>
> _______________________________________________
> litmus-dev mailing list
> litmus-dev at lists.litmus-rt.org
> https://lists.litmus-rt.org/listinfo/litmus-dev
>



-- 
Jonathan Herman
Department of Computer Science at UNC Chapel Hill
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.litmus-rt.org/pipermail/litmus-dev/attachments/20130220/3bef05b0/attachment.html>


More information about the litmus-dev mailing list