[Bug 2173] New: Potential integer overflow problem in EDF scheduler
bugzilla-daemon at rtems.org
bugzilla-daemon at rtems.org
Mon Mar 24 07:06:34 UTC 2014
https://www.rtems.org/bugzilla/show_bug.cgi?id=2173
Bug #: 2173
Summary: Potential integer overflow problem in EDF scheduler
Classification: Unclassified
Product: RTEMS
Version: HEAD
Platform: All
OS/Version: RTEMS
Status: NEW
Severity: normal
Priority: P3
Component: cpukit
AssignedTo: joel.sherrill at oarcorp.com
ReportedBy: sebastian.huber at embedded-brains.de
On 2014-03-21 14:46, Gedare Bloom wrote:> On Fri, Mar 21, 2014 at 9:43 AM,
Sebastian Huber
> <sebastian.huber at embedded-brains.de> wrote:
[...]
>> >I have another question regarding the EDF scheduler. Does this work in case
>> >_Watchdog_Ticks_since_boot overflows?
>> >
> No. For this, I think we need to use "deadline folding" which is just
> modulo arithmetic.
>
>> >void _Scheduler_EDF_Release_job(
>> > Thread_Control *the_thread,
>> > uint32_t deadline
>> >)
>> >{
>> > Priority_Control new_priority;
>> >
>> > if (deadline) {
>> > /* Initializing or shifting deadline. */
>> > new_priority = (_Watchdog_Ticks_since_boot + deadline)
>> > & ~SCHEDULER_EDF_PRIO_MSB;
>> > }
>> > else {
>> > /* Switch back to background priority. */
>> > new_priority = the_thread->Start.initial_priority;
>> > }
>> >
>> > the_thread->real_priority = new_priority;
>> > _Thread_Change_priority(the_thread, new_priority, true);
>> >
>> >}
_Watchdog_Ticks_since_boot us uint32_t and overflows after 49 days with a one
millisecond clock tick.
--
Configure bugmail: https://www.rtems.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.
More information about the bugs
mailing list