source: rtems/cpukit/score/include/rtems/score/schedulerprioritysmpimpl.h @ 238629f

4.115
Last change on this file since 238629f was 238629f, checked in by Joel Sherrill <joel.sherrill@…>, on 05/19/14 at 20:26:55

Add SMP Priority Scheduler with Affinity

This scheduler attempts to account for needed thread migrations caused
as a side-effect of a thread state, affinity, or priority change operation.

This scheduler has its own allocate_processor handler named
_Scheduler_SMP_Allocate_processor_exact() because
_Scheduler_SMP_Allocate_processor() attempts to prevent an executing
thread from moving off its current CPU without considering affinity.
Without this, the scheduler makes all the right decisions and then
they are discarded at the end.

==Side Effects of Adding This Scheduler==

Added Thread_Control * parameter to Scheduler_SMP_Get_highest_ready type
so methods looking for the highest ready thread can filter by the processor
on which the thread blocking resides. This allows affinity to be considered.
Simple Priority SMP and Priority SMP ignore this parameter.

+ Added get_lowest_scheduled argument to _Scheduler_SMP_Enqueue_ordered().

+ Added allocate_processor argument to the following methods:

  • _Scheduler_SMP_Block()
  • _Scheduler_SMP_Enqueue_scheduled_ordered()
  • _Scheduler_SMP_Enqueue_scheduled_ordered()

+ schedulerprioritysmpimpl.h is a new file with prototypes for methods

which were formerly static in schedulerprioritysmp.c but now need to
be public to be shared with this scheduler.

NOTE:

_Scheduler_SMP_Get_lowest_ready() appears to have a path which would
allow it to return a NULL. Previously, _Scheduler_SMP_Enqueue_ordered()
would have asserted on it. If it cannot return a NULL,
_Scheduler_SMP_Get_lowest_ready() should have an assertions.

  • Property mode set to 100644
File size: 1.8 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup ScoreSchedulerPrioritySMP
5 *
6 * @brief Deterministic Priority SMP Scheduler API
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_SCHEDULERPRIORITYSMPIMPL_H
24#define _RTEMS_SCORE_SCHEDULERPRIORITYSMPIMPL_H
25
26#include <rtems/score/scheduler.h>
27#include <rtems/score/schedulerpriority.h>
28#include <rtems/score/schedulersmp.h>
29
30#ifdef __cplusplus
31extern "C" {
32#endif /* __cplusplus */
33
34/**
35 * @ingroup ScoreSchedulerPrioritySMP
36 * @{
37 */
38
39Scheduler_priority_SMP_Context *_Scheduler_priority_SMP_Get_self(
40  Scheduler_Context *context
41);
42
43Scheduler_priority_SMP_Node *_Scheduler_priority_SMP_Node_get(
44  Thread_Control *thread
45);
46
47void _Scheduler_priority_SMP_Insert_ready_fifo(
48  Scheduler_Context *context,
49  Thread_Control *thread
50);
51
52void _Scheduler_priority_SMP_Insert_ready_lifo(
53  Scheduler_Context *context,
54  Thread_Control *thread
55);
56
57void _Scheduler_priority_SMP_Move_from_scheduled_to_ready(
58  Scheduler_Context *context,
59  Thread_Control *scheduled_to_ready
60);
61
62void _Scheduler_priority_SMP_Move_from_ready_to_scheduled(
63  Scheduler_Context *context,
64  Thread_Control *ready_to_scheduled
65);
66
67void _Scheduler_priority_SMP_Extract_from_ready(
68  Scheduler_Context *context,
69  Thread_Control *thread
70);
71
72void _Scheduler_priority_SMP_Do_update(
73  Scheduler_Context *context,
74  Scheduler_Node *base_node,
75  Priority_Control new_priority
76);
77
78/** @} */
79
80#ifdef __cplusplus
81}
82#endif /* __cplusplus */
83
84#endif /* _RTEMS_SCORE_SCHEDULERPRIORITYSMPIMPL_H */
Note: See TracBrowser for help on using the repository browser.