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

Gedare Bloom gedare at rtems.org
Thu Mar 29 20:14:34 UTC 2012


On Thu, Mar 29, 2012 at 4:07 PM, Joel Sherrill
<joel.sherrill at oarcorp.com> wrote:
> 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
>
Yes your analysis seems correct that the comment for the check on
Timestamp_Less_than seems to indicate the author intended at this
point in execution that h->current_priority ==
pheir->current_priority.

> --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
>
>
>
> _______________________________________________
> rtems-devel mailing list
> rtems-devel at rtems.org
> http://www.rtems.org/mailman/listinfo/rtems-devel




More information about the devel mailing list