[LITMUS^RT] Building MLLF scheduling algorithm in LITMUS

Marov Gazaal adamagaghz at gmail.com
Wed Sep 2 15:55:54 CEST 2020


Hello all. I am trying to build a scheduling algorithm called MLLF
(Modified Least Laxity First) that solves two problems which are increasing
context switch overheads and tying if two or more tasks have the same
deadline and same laxity. This policy has to know if there is an executing
task when another task arrives to make comparison between them and make a
decision to specify the task should work.

The behavior of this Policy is:
1- if there is one task in ready queue, the task which has the earliest
deadline is taken to execute on the CPU. Here, I used the EDF policy call
function inside MLLF when I programmed it in LITMUS.
2- if there is more than one task in such that there is a task is
executing(current task), and in an instance of time a task has been arrived
(arrival task) with deadline < deadline of executing task, then we should
to test if Laxity current < Laxity arrived, the executed task continues its
execution.
3- if the Deadline current > Deadline arrived, and Laxity current > Laxity
arrived , then we should take EDF in our account to specify the task that
will has the highest priority which is the arrived task in this case, so
context switch is necessary and arrival task starts its execution.
4- if Deadline arrived = Deadline current and Laxity arrived = Laxity
current, then the current task continues its execution.

I ask about some things, if you do not mind:
1- if I want to know or specify the task which is the arrived task, is
there a function can do that in litmus? I found two functions called
get_release(t) and the another is_present(t) which I supposed to benefit
for this but I'm not sure.
2- if I want to know or specify the task executed now, how to do that too?
I searched for and I found litmus_exec(void) function but i'm not sure too.

3- to calculate the Laxity, I tried to do that like this (but I don't know
if it is work):
laxity_ft = get_deadline(first) - litmus_clock() - get_exec_cost(first); //
L = D - t -e;
Note: laxity_ft is a variable from unsigned integer datatype.
I attached a picture of my MLLF code below.

I appreciate your help. sorry for prolonging.

Thanks in advance.
Marouf Ghazal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.litmus-rt.org/pipermail/litmus-dev/attachments/20200902/dd0eafc9/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MLLF.png
Type: image/png
Size: 296471 bytes
Desc: not available
URL: <http://lists.litmus-rt.org/pipermail/litmus-dev/attachments/20200902/dd0eafc9/attachment-0001.png>


More information about the litmus-dev mailing list