[PATCH 26] SMP: remove unused code in simple SMP scheduler

Joel Sherrill joel.sherrill at OARcorp.com
Thu Mar 29 20:07:11 UTC 2012


On 03/29/2012 06:52 AM, Daniel Hellstrom wrote:
> A similar if-statement is just above, I can see no reason why
> to have this double code.
I wonder if it shouldn't be a <.  The checks below here
assume the thread we are looking at placing is of
equal priority with the potential thread to be
displaced.

I don't trust myself enough to be sure this afternoon.
But read the code...

+ above this.. not found a pheir yet so looking
     for first lower priority thread

     - now looking to see if the old heir we found
      is more important than the h on cpu being considered
    *** check is here - below here assume == priority
    - check timestamp to honor FIFO within priority
    - check preemption to favor preemptible thread over
      putting thread on CPU with non-preemptible task

What do you all think? I think it is a bug not duped code

--joel

>
> Signed-off-by: Daniel Hellstrom<daniel at gaisler.com>
> ---
>   cpukit/score/src/schedulersimplesmpschedule.c |    3 ---
>   1 files changed, 0 insertions(+), 3 deletions(-)
>
> diff --git a/cpukit/score/src/schedulersimplesmpschedule.c b/cpukit/score/src/schedulersimplesmpschedule.c
> index d8fd06c..95be98a 100644
> --- a/cpukit/score/src/schedulersimplesmpschedule.c
> +++ b/cpukit/score/src/schedulersimplesmpschedule.c
> @@ -155,9 +155,6 @@ bool _Scheduler_simple_smp_Assign(
>         continue;
>       }
>
> -    if ( h->current_priority>  pheir->current_priority )
> -      continue;
> -
>       /*
>        *  If heir of potential CPU and of the current CPU are of the SAME
>        *  priority, then which has been running longer?


-- 
Joel Sherrill, Ph.D.             Director of Research&   Development
joel.sherrill at OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
     Support Available             (256) 722-9985





More information about the devel mailing list