source: rtems/cpukit/score/include/rtems/score/schedulersmp.h @ 5b1ff71a

4.115
Last change on this file since 5b1ff71a was 38b59a6, checked in by Sebastian Huber <sebastian.huber@…>, on 05/02/14 at 08:31:09

score: Implement forced thread migration

The current implementation of task migration in RTEMS has some
implications with respect to the interrupt latency. It is crucial to
preserve the system invariant that a task can execute on at most one
processor in the system at a time. This is accomplished with a boolean
indicator in the task context. The processor architecture specific
low-level task context switch code will mark that a task context is no
longer executing and waits that the heir context stopped execution
before it restores the heir context and resumes execution of the heir
task. So there is one point in time in which a processor is without a
task. This is essential to avoid cyclic dependencies in case multiple
tasks migrate at once. Otherwise some supervising entity is necessary to
prevent life-locks. Such a global supervisor would lead to scalability
problems so this approach is not used. Currently the thread dispatch is
performed with interrupts disabled. So in case the heir task is
currently executing on another processor then this prolongs the time of
disabled interrupts since one processor has to wait for another
processor to make progress.

It is difficult to avoid this issue with the interrupt latency since
interrupts normally store the context of the interrupted task on its
stack. In case a task is marked as not executing we must not use its
task stack to store such an interrupt context. We cannot use the heir
stack before it stopped execution on another processor. So if we enable
interrupts during this transition we have to provide an alternative task
independent stack for this time frame. This issue needs further
investigation.

  • Property mode set to 100644
File size: 964 bytes
Line 
1/**
2 * @file
3 *
4 * @brief SMP Scheduler API
5 *
6 * @ingroup ScoreSchedulerSMP
7 */
8
9/*
10 * Copyright (c) 2013-2014 embedded brains GmbH.  All rights reserved.
11 *
12 *  embedded brains GmbH
13 *  Dornierstr. 4
14 *  82178 Puchheim
15 *  Germany
16 *  <rtems@embedded-brains.de>
17 *
18 * The license and distribution terms for this file may be
19 * found in the file LICENSE in this distribution or at
20 * http://www.rtems.org/license/LICENSE.
21 */
22
23#ifndef _RTEMS_SCORE_SCHEDULERSMP_H
24#define _RTEMS_SCORE_SCHEDULERSMP_H
25
26#include <rtems/score/chain.h>
27#include <rtems/score/scheduler.h>
28
29#ifdef __cplusplus
30extern "C" {
31#endif /* __cplusplus */
32
33/**
34 * @defgroup ScoreSchedulerSMP SMP Scheduler
35 *
36 * @ingroup ScoreScheduler
37 *
38 * @{
39 */
40
41typedef struct {
42  /**
43   * @brief Basic scheduler context.
44   */
45  Scheduler_Context Base;
46
47  Chain_Control Scheduled;
48} Scheduler_SMP_Context;
49
50/** @} */
51
52#ifdef __cplusplus
53}
54#endif /* __cplusplus */
55
56#endif /* _RTEMS_SCORE_SCHEDULERSMP_H */
Note: See TracBrowser for help on using the repository browser.