#2772 closed enhancement (duplicate)

Enhancement for more general real-time model

Reported by: Kuan-Hsun Chen Owned by:
Priority: high Milestone: 4.11.1
Component: score Version: 4.11
Severity: major Keywords: RMS, SP, Scheduler, Periodicity
Cc: Gedare Bloom, Joel Sherrill Blocked By:
Blocking:

Description

In the current implementation, if a task period is time out, the next call of rtems_rate_monotonic_period() will only release one following job and manipulate the task period with the calling moment + the next length of period. With the assumption that implicit/constraint deadline and hard real-time model, the above mechanism is okay.

However, it is not applicable for more general task models, e.g., soft real-time task, arbitrary deadline, mixed-criticality system [1-4]. It is in fact changing the behaviour of periodic/sporadic tasks, where the task period becomes unpredictable and shifted . Also, there maybe more than one postponed instances due to the preemption.

Although there is no standard requirement in reality for deadline misses, with this enhancement, the postponed jobs will be released with the correct number without shifting the periodicity of tasks. In fact, this way of handling is already widely considered in academia from 90s [2] until now [3] or even on multicores as well [4].

I refine the following four files and handle this requirement individually. The overhead seems to me negligible.
cpukit/rtems/include/rtems/rtems/ratemon.h
cpukit/rtems/include/rtems/rtems/ratemonimpl.h
cpukit/rtems/src/ratemontimeout.c
cpukit/rtems/src/ratemonperiod.c

I believe this patch is good for further use in more general real-time task models.
This enhancement only affect those timeout cases without changing any behaviour in normal cases.
To demonstrate the differences, a heuristic example is prepared in testsuites/sptests/sprmsched01 to show the benefit of the enhancement:

Given two tasks with implicit deadline that task deadline is equal to its period.
Task 1 period is 10000 ticks, whereas task 2 is 2000 ticks.
Task 1 has the execution time 6000 ticks, and task 2 has 1000 ticks.
Assume Task 1 has a higher priority than task 2. Task 1 only executes 2 times.
In the expected result, we can observe that the postponed jobs are continuously released till there is no postponed job left, and the task period will still keep as it is.
(Job 3-7 in task 2 are postponed jobs)

[1] Buttazzo et al., Soft Real-Time Systems: Predictability vs. Efficiency, Springer 2005, http://www.springer.com/gp/book/9780387237015
[2] Lehoczky et al., Fixed priority scheduling of periodic task sets with arbitrary deadlines, RTSS 1990, http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=128748
[3] Georg von der Brüggen et al., Systems with Dynamic Real-Time Guarantees in Uncertain and Faulty Execution Environments, RTSS'16, accepted.
[4] Huang et al., Response time bounds for sporadic arbitrary-deadline tasks under global fixed-priority scheduling on multiprocessors, RTNS 2015, http://dl.acm.org/citation.cfm?doid=2597457.2597459

Attachments (9)

sprmsched01.scn (2.2 KB) - added by Kuan-Hsun Chen on Aug 5, 2016 at 4:35:50 PM.
scn file
sprmsched01.doc (1.0 KB) - added by Kuan-Hsun Chen on Aug 5, 2016 at 4:36:04 PM.
doc file
tasks.c (3.7 KB) - added by Kuan-Hsun Chen on Aug 5, 2016 at 4:36:33 PM.
Example file
system.h (1.9 KB) - added by Kuan-Hsun Chen on Aug 5, 2016 at 4:37:43 PM.
Example system file
init.c (2.3 KB) - added by Kuan-Hsun Chen on Aug 5, 2016 at 4:38:05 PM.
Example init task
Makefile.am (585 bytes) - added by Kuan-Hsun Chen on Aug 5, 2016 at 4:38:27 PM.
Example Makefile
cpukit.tar (6.9 KB) - added by Kuan-Hsun Chen on Aug 5, 2016 at 4:42:51 PM.
cpukit patch including 4 files
sprmsched01.tar (3.5 KB) - added by Kuan-Hsun Chen on Aug 5, 2016 at 4:45:53 PM.
sprmsched01 example files
new-feature.patch (119.2 KB) - added by Kuan on Aug 5, 2016 at 6:33:26 PM.
diff patch

Download all attachments as: .zip

Change History (12)

Changed on Aug 5, 2016 at 4:35:50 PM by Kuan-Hsun Chen

Attachment: sprmsched01.scn added

scn file

Changed on Aug 5, 2016 at 4:36:04 PM by Kuan-Hsun Chen

Attachment: sprmsched01.doc added

doc file

Changed on Aug 5, 2016 at 4:36:33 PM by Kuan-Hsun Chen

Attachment: tasks.c added

Example file

Changed on Aug 5, 2016 at 4:37:43 PM by Kuan-Hsun Chen

Attachment: system.h added

Example system file

Changed on Aug 5, 2016 at 4:38:05 PM by Kuan-Hsun Chen

Attachment: init.c added

Example init task

Changed on Aug 5, 2016 at 4:38:27 PM by Kuan-Hsun Chen

Attachment: Makefile.am added

Example Makefile

Changed on Aug 5, 2016 at 4:42:51 PM by Kuan-Hsun Chen

Attachment: cpukit.tar added

cpukit patch including 4 files

Changed on Aug 5, 2016 at 4:45:53 PM by Kuan-Hsun Chen

Attachment: sprmsched01.tar added

sprmsched01 example files

Changed on Aug 5, 2016 at 6:33:26 PM by Kuan

Attachment: new-feature.patch added

diff patch

comment:1 Changed on Jan 25, 2017 at 1:04:07 PM by Sebastian Huber

Is this a duplicate of #2795?

comment:2 Changed on Jan 25, 2017 at 1:04:47 PM by Kuan-Hsun Chen

yes, please delete it

comment:3 Changed on Jan 25, 2017 at 1:29:34 PM by Sebastian Huber

Resolution: duplicate
Status: newclosed
Note: See TracTickets for help on using tickets.