summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/schedulerpriorityaffinitysmp.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-07-11 09:47:05 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-07-11 09:55:33 +0200
commitf0c8501e4c77322a9d66a2124cce470cdecd0595 (patch)
tree5f76cb98452c98b132118b48b6e0436bffd813e3 /cpukit/score/src/schedulerpriorityaffinitysmp.c
parentscore: Fix scheduler helping implementation (diff)
downloadrtems-f0c8501e4c77322a9d66a2124cce470cdecd0595.tar.bz2
score: Scheduler helping proto for affinity sched
The priority affinity scheduler has the nice property that it can produce more than one scheduled to ready state change in one operation. Each scheduled to ready state change may lead to one thread in need for help. Since it is currently only possible to return at most one thread in need for help, we have a problem here. A solution might be to move the check for migrations into the ask for help mechanism.
Diffstat (limited to 'cpukit/score/src/schedulerpriorityaffinitysmp.c')
-rw-r--r--cpukit/score/src/schedulerpriorityaffinitysmp.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/cpukit/score/src/schedulerpriorityaffinitysmp.c b/cpukit/score/src/schedulerpriorityaffinitysmp.c
index 41e44a0834..98487ec43f 100644
--- a/cpukit/score/src/schedulerpriorityaffinitysmp.c
+++ b/cpukit/score/src/schedulerpriorityaffinitysmp.c
@@ -355,6 +355,14 @@ static void _Scheduler_priority_affinity_SMP_Check_for_migrations(
break;
/*
+ * FIXME: Do not consider threads using the scheduler helping protocol
+ * since this could produce more than one thread in need for help in one
+ * operation which is currently not possible.
+ */
+ if ( lowest_scheduled->help_state != SCHEDULER_HELP_YOURSELF )
+ break;
+
+ /*
* But if we found a thread which is lower priority than one
* in the ready set, then we need to swap them out.
*/
@@ -363,6 +371,10 @@ static void _Scheduler_priority_affinity_SMP_Check_for_migrations(
_Scheduler_SMP_Node_downcast( lowest_scheduled ),
SCHEDULER_SMP_NODE_READY
);
+ _Scheduler_Thread_change_state(
+ _Scheduler_Node_get_user( lowest_scheduled ),
+ THREAD_SCHEDULER_READY
+ );
_Scheduler_SMP_Allocate_processor(
context,