[LITMUS^RT] request for review: patches for arbitrary deadlines
Jonathan Herman
hermanjl at cs.unc.edu
Tue Jul 17 05:10:21 CEST 2012
We could avoid future API pain by passing in initialized rt_task
structs into sporadic_task_ns. This would also make it easier to add
in extra per-task fields for per-paper branches, which has been
handled awkwardly in the past. Besides, I've heard that 7 was a good
hard limit for number of parameters to a function. Now
sporadic_task_ns has 8.
> + lt_t rdeadline;
Why not just deadline? I doubt there will be confusion, and it looks a
tad cleaner.
> - if (tp.period < tp.exec_cost)
> + if (tp.rdeadline < tp.exec_cost)
> {
> printk(KERN_INFO "litmus: real-time task %d rejected "
> - "because wcet > period\n", pid);
> + "because wcet greater than relative deadline\n", pid);
> goto out_unlock;
> }
As far as I can tell, this means there is no longer a check that
tp.period >= tp.exec_cost. Am I wrong?
> + BUG_ON(!t);
> +
> + /* prepare next release */
> + t->rt_param.job_params.release = start;
> + t->rt_param.job_params.deadline = start + get_rt_rdeadline(t);
> + t->rt_param.job_params.exec_time = 0;
> +
> + /* update job sequence number */
> + t->rt_param.job_params.job_no++;
> +
> + /* don't confuse Linux */
> + t->rt.time_slice = 1;
> +
The following might be a lesser evil. Duplicated logic is always scary.
inline void do_release(struct task_struct *t, lt_t time)
{
BUG_ON(!t);
/* prepare next release */
t->rt_param.job_params.release = time;
t->rt_param.job_params.deadline = time+ get_rt_rdeadline(t);
t->rt_param.job_params.exec_time = 0;
/* update job sequence number */
t->rt_param.job_params.job_no++;
/* don't confuse Linux */
t->rt.time_slice = 1;
}
void release(struct task_struct *t)
{
do_release(get_release(t) + get_rt_deadline(t));
}
void release_at(struct task_struct *t, lt_t time)
{
do_release(t, time);
set_rt_flags(t, RT_F_RUNNING);
}
Having the capabilities in this patch seems super reasonable to me.
On Mon, Jul 16, 2012 at 5:52 PM, Glenn Elliott <gelliott at cs.unc.edu> wrote:
> Hello All,
>
> Please find two patched attached for review that add support for
> arbitrary deadlines in Litmus. One patch is for litmus and the other
> is for liblitmus. Please read the patch commit messages for more
> information.
>
> I'm not exactly happy with the API changes for liblitmus because they
> are disruptive with legacy code (a relative deadline has been added).
> However, this seemed to be the correct change with respect to the API
> though.
>
> Patches are also available for view at rtsrv.unc.edu/cgit for UNC folks.
>
> Thanks,
> Glenn
>
> _______________________________________________
> 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
More information about the litmus-dev
mailing list