[rtems commit] Simple SMP Scheduler - Fix typo which likely broke scheduling
Joel Sherrill
joel at rtems.org
Tue Apr 24 21:16:52 UTC 2012
Module: rtems
Branch: master
Commit: 32815a26361f8ded3e9402007a7cfbc6354966c3
Changeset: http://git.rtems.org/rtems/commit/?id=32815a26361f8ded3e9402007a7cfbc6354966c3
Author: Joel Sherrill <joel.sherrill at oarcorp.com>
Date: Tue Apr 24 16:08:16 2012 -0500
Simple SMP Scheduler - Fix typo which likely broke scheduling
---
cpukit/score/src/schedulersimplesmpschedule.c | 39 +++++++++++++++++++-----
1 files changed, 31 insertions(+), 8 deletions(-)
diff --git a/cpukit/score/src/schedulersimplesmpschedule.c b/cpukit/score/src/schedulersimplesmpschedule.c
index d8fd06c..471f710 100644
--- a/cpukit/score/src/schedulersimplesmpschedule.c
+++ b/cpukit/score/src/schedulersimplesmpschedule.c
@@ -1,14 +1,16 @@
-/*
- * Scheduler Simple SMP Handler / Schedule
+/**
+ * @file
*
- * COPYRIGHT (c) 2011.
+ * Scheduler Simple SMP Handler / Schedule
+ */
+
+/*
+ * COPYRIGHT (c) 2011- 2012.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
* found in found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
- *
- * $Id$
*/
#if HAVE_CONFIG_H
@@ -36,6 +38,11 @@
#define D(format,...)
#endif
+/* Declaration to avoid warnings */
+bool _Scheduler_simple_smp_Assign(
+ Thread_Control *consider
+);
+
/**
* @brief Assign Heir Thread to CPU
*
@@ -56,7 +63,6 @@
* false, there is no point in attempting to place an heir of
* of lower priority.
*/
-
bool _Scheduler_simple_smp_Assign(
Thread_Control *consider
)
@@ -134,7 +140,12 @@ bool _Scheduler_simple_smp_Assign(
}
/*
- * Past this point, found is true.
+ * ASSERTION: (found == true)
+ *
+ * Past this point, we have found a potential heir and are considering
+ * whether the thread is better placed on another core. It is desirable
+ * to preempt the lowest priority thread using time on core and
+ * preemptibility as additional factors.
*/
/*
@@ -155,10 +166,22 @@ bool _Scheduler_simple_smp_Assign(
continue;
}
- if ( h->current_priority > pheir->current_priority )
+ /*
+ * If the current heir is more important than the potential
+ * heir, then we should not consider it further in scheduling.
+ */
+ if ( h->current_priority < pheir->current_priority )
continue;
/*
+ * ASSERTION: (h->current_priority == pheir->current_priority).
+ *
+ * Past this point, this means we are considering the length of time
+ * the thread has spent on the time on the CPU core and if it is
+ * preemptible.
+ */
+
+ /*
* If heir of potential CPU and of the current CPU are of the SAME
* priority, then which has been running longer?
*
More information about the vc
mailing list