WO2003091878A2 - Reduced overhead context-saving in static priority scheduled operating systems - Google Patents
Reduced overhead context-saving in static priority scheduled operating systems Download PDFInfo
- Publication number
- WO2003091878A2 WO2003091878A2 PCT/GB2003/001609 GB0301609W WO03091878A2 WO 2003091878 A2 WO2003091878 A2 WO 2003091878A2 GB 0301609 W GB0301609 W GB 0301609W WO 03091878 A2 WO03091878 A2 WO 03091878A2
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- tasks
- resource
- task
- context
- operating system
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/4881—Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/461—Saving or restoring of program or task context
- G06F9/463—Program control block organisation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
Definitions
- the present invention relates to methods and systems for reducing memory and processor usage in operating systems that make use of static priority-based scheduling, specifically, in reducing the need for resource saving on inter-task context switches.
- Embodiments of the present invention are of particular relevance to the technical field of embedded devices and the control thereof, since these generally use static priority-based scheduling given the limited range of functions required.
- Embodiments of the present invention may be used in conjunction with an invention disclosed in the present applicant's copending UK patent application no 0209800.2 of 30 th April 2002, a copy of which is being filed with the present application and the full contents of which are hereby incorporated into the present application by reference.
- Embodiments of the present invention relate to reducing the amount of context that needs to be saved when making a context switch between any two tasks.
- the present invention is described in terms of its application to an operating system with single-stack, single-shot, run-to-completion task semantics though is generally applicable to other forms of tasking model.
- a method of reducing memory or processor usage in an operating system that uses static priority- based scheduling for tasks, wherein a reduced number of resource contexts required by the operating system is calculated by determining which tasks make use of resource contexts that must be saved and restored and wherein wrappers or dispatchers are provided for tasks that must save and restore such resource contexts.
- a computing device having an operating system that uses static priority-based scheduling for tasks, the computing device being operable to calculate a reduced number of resource contexts required by the operating system by determining which tasks make use of resource contexts that must be saved and restored, and wherein the computing device provides wrappers or dispatchers for tasks that must save and restore such resource contexts.
- a software product for use with a computing device having an operating system that uses static priority-based scheduling for tasks, the software product being operable to calculate a reduced number of resource contexts required by the operating system by determining which tasks make use of resource contexts that must be saved and restored, and wherein the software product provides wrappers or dispatchers for tasks that must save and restore such resource contexts.
- the software product may be in any appropriate form or language, and may be stored on a data carrier such as a floppy disk, optical disk, flash memory device or any other type of data carrier.
- a “wrapper” in this application is defined to be a fragment of program code that encapsulates a task and is called in its place by the underlying operating system - for example, if we consider a task "task_l” whose "entry” (the function that carries out useful work) is defined as follows:
- a "dispatcher” performs essentially the same activities, but rather than the task entry function being replaced, the operating system itself is modified to make the pre- and post-task calls. For example, we might find the following code inside the operating system:
- task *t os_find_ ighest_priority_runnable_task() ; if (t->priority > os_current_task->priority) ⁇ do_stuff_that_must_be_done_before_calling_task () ; t->entry () ; do_stuf f_that_must_be_done_before_calling_task ( ) ;
- this system would require five "resource contexts" - one for each of tasks a, b, c, d and e to save their resources into when they are pre-empted by higher priority tasks.
- Each task would be protected by a "wrapper” that ensures that the "resource context” would be saved into the appropriate buffer and the operating system dispatcher would call this instead of the task entry function - for example, instead of jumping direct to "task_d_entry" the system dispatcher would call a wrapper:
- wrapper being generated in a C-like language and including the declaration of the "resource context" itself- though this could also be generated in assembly language with appropriate code and data declarations, or could be brought about by calling different variants or branches of the operating system dispatcher function).
- the system dispatcher in this case could use a table of function pointers to decide which function to call for each task, hi a hypothetical assembly language this might appear as below: task_entry_tab: PUBLIC
- task a priority 1 uses fp
- task b priority 2 uses fp
- task c priority 3 uses fp
- task d priority 4 uses fp
- task e priority 5 uses fp
- the "uses fp" declaration is added to indicate that a task uses the floating-point coprocessor. If a task does not explicitly mention that it uses something that requires a "resource context”, then one is not provided (and no wrapper is needed - the OS can call the task's entry function directly).
- task a priority 1 uses fp
- task b priority 2 uses fp
- task c priority 3 uses fp
- task d priority 4 uses fp
- task e priority 5 uses mutex a, b;
- task a priority 1 uses fp
- task b priority 2 uses fp
- task c priority 3 uses fp
- task d priority 4 uses fp
- task e priority 5 uses mutex c, d;
- wrappers might be of the form:
- Mutexes is a list of all mutexes in the system -- Tasks is a list of tasks sorted into priority order.
- c3 new Context (merge_context (cl, c2) ) ; append (c3 , Contexts) ;
- delete_contex Contexts, cl
- delete_context Contexts, c2
- wrapper_set_context w, c3)
- wrapper_set_context x, c3) ; end if; end for; end for;
- this algorithm is merely an example of a way to determine resource contexts; embodiments of the present invention may use this algorithm or any other appropriate algorithm or method that achieves the same or a similar effect.
- DSP digital signal processor
- task a priority 1 uses fp
- task b priority 2 uses dsp, fp
- task c priority 3 uses fp
- task d priority 4 uses dsp
- task e priority 5 uses dsp, fp
- task f priority 6 uses fp;
- Task a needs no wrapper (since the pre-empter saves the resources)
- Task b needs a wrapper that saves only the "fp" context (it is the lowest priority task that uses the "dsp” context, so does not need to save it)
- Task c needs a wrapper that saves only the "fp" context
- Task d needs a wrapper that saves only the "dsp" context (it is the first preempting task to use it)
- Task e needs a wrapper that saves both contexts
- Task f needs a wrapper that saves only the "fp" context.
- Such wrappers can be automatically generated from code skeletons provided by the user of the configuration tool.
- a method of integrating results from a timing analysis tool with an operating system configuration tool in such a way that when it is shown by the timing analysis tool that a particular task never pre-empts another task or tasks with which it contends for a resource, only a single resource context is generated, the single resource context being shared by the tasks.
- a computing device adapted to integrate results from a timing analysis tool with an operating system configuration tool in such a way that when it is shown by the timing analysis tool that a particular task never pre-empts another task with which it contends for a resource, only a single resource context is generated, the single resource context being shared by the tasks.
- a software product for a computing device being adapted to integrate results from a timing analysis tool with an operating system configuration tool in such a way that when it is shown by the timing analysis tool that a particular task never pre-empts another task with which it contends for a resource, only a single resource context is generated, the single resource context being shared by the tasks.
- the results of a timing analysis which may be heuristic in nature, can be used in place of or in addition to results from a formal schedulability analysis so as to designate tasks as being effectively in mutual exclusion. In this way, duplication of resource contexts and/or wrappers is avoided.
- a timing analysis may be obtained by way of a timing analysis tool that applies techniques such as Rate Monotonic Analysis and extensions thereof in order to determine, among other things, when a given task might be executing, the latest time at which the given task might complete, and which other tasks can possibly pre-empt the given task.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Electrotherapy Devices (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
- Executing Machine-Instructions (AREA)
- Stored Programmes (AREA)
- Memory System (AREA)
- Debugging And Monitoring (AREA)
Abstract
Description
Claims
Priority Applications (3)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| AU2003224280A AU2003224280A1 (en) | 2002-04-25 | 2003-04-16 | Reduced overhead context-saving in static priority scheduled operating systems |
| DE60317500T DE60317500T2 (en) | 2002-04-25 | 2003-04-16 | LESS COST CONTEXT SWITCHING IN STATIC PRIORITY CONTROL SYSTEMS |
| EP03720704A EP1502187B1 (en) | 2002-04-25 | 2003-04-16 | Reduced overhead context-saving in static priority scheduled operating systems |
Applications Claiming Priority (4)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| GB0209479A GB2387931A (en) | 2002-04-25 | 2002-04-25 | Reduced-overhead context-saving in static priority scheduled operating systems |
| GB0209479.5 | 2002-04-25 | ||
| US10/146,654 | 2002-05-14 | ||
| US10/146,654 US7082607B2 (en) | 2002-04-25 | 2002-05-14 | Reduced-overhead context-saving in static priority scheduled operating systems |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| WO2003091878A2 true WO2003091878A2 (en) | 2003-11-06 |
| WO2003091878A3 WO2003091878A3 (en) | 2004-11-25 |
Family
ID=29271999
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/GB2003/001609 Ceased WO2003091878A2 (en) | 2002-04-25 | 2003-04-16 | Reduced overhead context-saving in static priority scheduled operating systems |
Country Status (4)
| Country | Link |
|---|---|
| EP (1) | EP1502187B1 (en) |
| AT (1) | ATE378633T1 (en) |
| AU (1) | AU2003224280A1 (en) |
| WO (1) | WO2003091878A2 (en) |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH05127926A (en) * | 1991-10-31 | 1993-05-25 | Nec Corp | Task controller |
| CA2131406C (en) * | 1993-09-21 | 2002-11-12 | David D'souza | Preemptive multi-tasking with cooperative groups of tasks |
| US5799188A (en) * | 1995-12-15 | 1998-08-25 | International Business Machines Corporation | System and method for managing variable weight thread contexts in a multithreaded computer system |
-
2003
- 2003-04-16 AT AT03720704T patent/ATE378633T1/en not_active IP Right Cessation
- 2003-04-16 AU AU2003224280A patent/AU2003224280A1/en not_active Abandoned
- 2003-04-16 EP EP03720704A patent/EP1502187B1/en not_active Expired - Lifetime
- 2003-04-16 WO PCT/GB2003/001609 patent/WO2003091878A2/en not_active Ceased
Also Published As
| Publication number | Publication date |
|---|---|
| AU2003224280A1 (en) | 2003-11-10 |
| AU2003224280A8 (en) | 2003-11-10 |
| EP1502187A2 (en) | 2005-02-02 |
| WO2003091878A3 (en) | 2004-11-25 |
| ATE378633T1 (en) | 2007-11-15 |
| EP1502187B1 (en) | 2007-11-14 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| Lipari et al. | Efficient Scheduling of Real-Time Multi-Task Applications in Dynamic Systems. | |
| US5515538A (en) | Apparatus and method for interrupt handling in a multi-threaded operating system kernel | |
| JP2561801B2 (en) | Method and system for managing process scheduling | |
| US7082607B2 (en) | Reduced-overhead context-saving in static priority scheduled operating systems | |
| CA3172791C (en) | Scheduling of threads for clusters of processors | |
| Burns et al. | Fixed priority scheduling with deadlines prior to completion | |
| Dellinger et al. | ChronOS Linux: a best-effort real-time multiprocessor Linux kernel | |
| GB2392515A (en) | Stack usage in computer operating systems | |
| Baranov et al. | Density of multi-task real-time applications | |
| EP1502187B1 (en) | Reduced overhead context-saving in static priority scheduled operating systems | |
| Rajkumar et al. | An optimal priority inheritance policy for synchronization in real-time systems | |
| Molnos et al. | Decoupled inter-and intra-application scheduling for composable and robust embedded MPSoC platforms | |
| EP4174647A1 (en) | Thread state transitions | |
| EP0544822B1 (en) | Dual level scheduling of processes | |
| Chishiro | Rt-seed: Real-time middleware for semi-fixed-priority scheduling | |
| Maia et al. | Scheduling parallel real-time tasks using a fixed-priority work-stealing algorithm on multiprocessors | |
| Choi et al. | Work-in-progress: A unified runtime framework for weakly-hard real-time systems | |
| CA3172802A1 (en) | Interrupt handling | |
| Faggioli et al. | An efficient implementation of the bandwidth inheritance protocol for handling hard and soft real-time applications in the linux kernel | |
| Dos Santos et al. | On the design and implementation of real-time resource access protocols | |
| Burns et al. | Combining EDF and FP scheduling: Analysis and implementation in Ada 2005 | |
| Sáez et al. | Deferred setting of scheduling attributes in ada 2012 | |
| Lo et al. | Architectural considerations in the design of real-time kernels | |
| Kwon et al. | A framework accommodating categorized multiprocessor real-time scheduling in the RTSJ | |
| WO2004021187A2 (en) | Improvements relating to stack usage in computerrelated operating systems |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| AK | Designated states |
Kind code of ref document: A2 Designated state(s): AE AG AL AM AT AU AZ BA BB BG BR BY BZ CA CH CN CO CR CU CZ DE DK DM DZ EC EE ES FI GB GD GE GH GM HR HU ID IL IN IS JP KE KG KP KR KZ LC LK LR LS LT LU LV MA MD MG MK MN MW MX MZ NI NO NZ OM PH PL PT RO RU SC SD SE SG SK SL TJ TM TN TR TT TZ UA UG US UZ VC VN YU ZA ZM ZW |
|
| AL | Designated countries for regional patents |
Kind code of ref document: A2 Designated state(s): GH GM KE LS MW MZ SD SL SZ TZ UG ZM ZW AM AZ BY KG KZ MD RU TJ TM AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HU IE IT LU MC NL PT RO SE SI SK TR BF BJ CF CG CI CM GA GN GQ GW ML MR NE SN TD TG |
|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application | ||
| WWE | Wipo information: entry into national phase |
Ref document number: 2003720704 Country of ref document: EP |
|
| WWP | Wipo information: published in national office |
Ref document number: 2003720704 Country of ref document: EP |
|
| NENP | Non-entry into the national phase |
Ref country code: JP |
|
| WWW | Wipo information: withdrawn in national office |
Country of ref document: JP |
|
| WWG | Wipo information: grant in national office |
Ref document number: 2003720704 Country of ref document: EP |