[rtems commit] score: Scheduler helping proto for affinity sched

Sebastian Huber sebh at rtems.org
Fri Jul 11 08:23:21 UTC 2014


Module:    rtems
Branch:    master
Commit:    f0c8501e4c77322a9d66a2124cce470cdecd0595
Changeset: http://git.rtems.org/rtems/commit/?id=f0c8501e4c77322a9d66a2124cce470cdecd0595

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Jul 11 09:47:05 2014 +0200

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.

---

 cpukit/score/src/schedulerpriorityaffinitysmp.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/cpukit/score/src/schedulerpriorityaffinitysmp.c b/cpukit/score/src/schedulerpriorityaffinitysmp.c
index 41e44a0..98487ec 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,



More information about the vc mailing list