diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-04-09 15:07:54 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-04-15 10:41:44 +0200 |
commit | c5831a3f9af11228dbdaabaf01f69d37e55684ef (patch) | |
tree | e9ddedd942f3f31d239820dfc4dbcef4cde0b09a /cpukit/score/include/rtems/score/scheduler.h | |
parent | rtems: Add task get/set scheduler (diff) | |
download | rtems-c5831a3f9af11228dbdaabaf01f69d37e55684ef.tar.bz2 |
score: Add clustered/partitioned scheduling
Clustered/partitioned scheduling helps to control the worst-case
latencies in the system. The goal is to reduce the amount of shared
state in the system and thus prevention of lock contention. Modern
multi-processor systems tend to have several layers of data and
instruction caches. With clustered/partitioned scheduling it is
possible to honour the cache topology of a system and thus avoid
expensive cache synchronization traffic.
We have clustered scheduling in case the set of processors of a system
is partitioned into non-empty pairwise-disjoint subsets. These subsets
are called clusters. Clusters with a cardinality of one are partitions.
Each cluster is owned by exactly one scheduler instance.
Diffstat (limited to 'cpukit/score/include/rtems/score/scheduler.h')
-rw-r--r-- | cpukit/score/include/rtems/score/scheduler.h | 64 |
1 files changed, 61 insertions, 3 deletions
diff --git a/cpukit/score/include/rtems/score/scheduler.h b/cpukit/score/include/rtems/score/scheduler.h index 3fd47c78a2..9002ef85d9 100644 --- a/cpukit/score/include/rtems/score/scheduler.h +++ b/cpukit/score/include/rtems/score/scheduler.h @@ -102,7 +102,7 @@ typedef struct { ); /** perform scheduler update actions required at each clock tick */ - void ( *tick )( const Scheduler_Control * ); + void ( *tick )( const Scheduler_Control *, Thread_Control * ); /** * @brief Starts the idle thread for a particular processor. @@ -149,7 +149,12 @@ typedef struct { * this structure at the begin of its context structure. */ typedef struct { - /* No fields yet */ +#if defined(RTEMS_SMP) + /** + * @brief Count of processors owned by this scheduler instance. + */ + uint32_t processor_count; +#endif } Scheduler_Context; /** @@ -198,6 +203,55 @@ extern const Scheduler_Control _Scheduler_Table[]; #define _Scheduler_Count ( (size_t) 1 ) #endif +#if defined(RTEMS_SMP) + /** + * @brief The scheduler assignment default attributes. + */ + #define SCHEDULER_ASSIGN_DEFAULT UINT32_C(0x0) + + /** + * @brief The presence of this processor is optional. + */ + #define SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL SCHEDULER_ASSIGN_DEFAULT + + /** + * @brief The presence of this processor is mandatory. + */ + #define SCHEDULER_ASSIGN_PROCESSOR_MANDATORY UINT32_C(0x1) + + /** + * @brief Scheduler assignment. + */ + typedef struct { + /** + * @brief The scheduler for this processor. + */ + const Scheduler_Control *scheduler; + + /** + * @brief The scheduler assignment attributes. + * + * Use @ref SCHEDULER_ASSIGN_DEFAULT to select default attributes. + * + * The presence of a processor can be + * - @ref SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL, or + * - @ref SCHEDULER_ASSIGN_PROCESSOR_MANDATORY. + */ + uint32_t attributes; + } Scheduler_Assignment; + + /** + * @brief The scheduler assignments. + * + * The length of this array must be equal to the maximum processors. + * + * Application provided via <rtems/confdefs.h>. + * + * @see _Scheduler_Table and rtems_configuration_get_maximum_processors(). + */ + extern const Scheduler_Assignment _Scheduler_Assignments[]; +#endif + /** * @brief Returns an arbitrary non-NULL value. * @@ -253,8 +307,12 @@ void _Scheduler_default_Release_job( * This routine is invoked as part of processing each clock tick. * * @param[in] scheduler The scheduler. + * @param[in] execution An executing thread. */ -void _Scheduler_default_Tick( const Scheduler_Control *scheduler ); +void _Scheduler_default_Tick( + const Scheduler_Control *scheduler, + Thread_Control *executing +); /** * @brief Starts an idle thread. |