diff options
author | Joel Sherrill <joel.sherrill@oarcorp.com> | 2012-04-24 16:08:16 -0500 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@oarcorp.com> | 2012-04-24 16:10:01 -0500 |
commit | 32815a26361f8ded3e9402007a7cfbc6354966c3 (patch) | |
tree | 057d48254056e3caf5b3cfd68f217c13389d568e /cpukit | |
parent | bsp/mpc55xxevb: Enable stack allocator (diff) | |
download | rtems-32815a26361f8ded3e9402007a7cfbc6354966c3.tar.bz2 |
Simple SMP Scheduler - Fix typo which likely broke scheduling
Diffstat (limited to 'cpukit')
-rw-r--r-- | 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 d8fd06c400..471f710ede 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? * |