Re: [PATCH] score: Remove PRIORITY_PSEUDO_ISR thread priority

2022-07-26 Thread Sebastian Huber

On 22/07/2022 14:35, Sebastian Huber wrote:



On 21.07.22 16:20, Joel Sherrill wrote:



On Thu, Jul 21, 2022 at 12:53 AM Sebastian Huber 
> wrote:


    Hello Gedare and Joel,

    On 15.07.22 10:43, Sebastian Huber wrote:
 > The uniprocessor schedulers had some special case logic for the
 > PRIORITY_PSEUDO_ISR priority.  Tasks with a priority of
    PRIORITY_PSEUDO_ISR
 > were allowed to preempt a not preemptible task.  If other higher
    priority task
 > are made ready while a PRIORITY_PSEUDO_ISR task preempts a not
    preemptible
 > task, then the other tasks run before the not preemptible task. 
    This made the

 > RTEMS_NO_PREEMPT mode ineffective.
 >
 > Remove the PRIORITY_PSEUDO_ISR special case logic.  This
    simplifies the
 > uniprocessor schedulers.  Move the uniprocessor-specific
    scheduler support to
 > the new header file .
 >
 > Close #2365.


I'm guessing that  PRIORITY_PSEUDO_ISR wasn't used outside RTEMS itself
and likely only historically for the Timer Server Thread. The 
protection for that
thread was reworked as part of the SMP efforts. If it is used outside 
RTEMS,

that would be a user facing breakage and should be documented.

If you think all the use cases of PRIORITY_PSEUDO_ISR are accounted for,
I'm ok with removing it.


The pseudo-interrupt priority is mentioned in a glossary entry:

     priority boosting
     A simple approach to extend the priority inheritance protocol for
     clustered scheduling is priority boosting.  In case a mutex is 
owned by a
     task of another cluster, then the priority of the owner task is 
raised to

     an artificially high priority, the pseudo-interrupt priority.

This entry was added for the clustered scheduling documentation and 
needs to be changed.


I found no reference to the no-preempt break of the pseudo-interrupt 
priority in the documentation. I doubt that there is an application 
which relies on this extraordinary feature.


I updated the documentation and committed the patch.

--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH] score: Remove PRIORITY_PSEUDO_ISR thread priority

2022-07-22 Thread Sebastian Huber



On 21.07.22 16:20, Joel Sherrill wrote:



On Thu, Jul 21, 2022 at 12:53 AM Sebastian Huber 
> wrote:


Hello Gedare and Joel,

On 15.07.22 10:43, Sebastian Huber wrote:
 > The uniprocessor schedulers had some special case logic for the
 > PRIORITY_PSEUDO_ISR priority.  Tasks with a priority of
PRIORITY_PSEUDO_ISR
 > were allowed to preempt a not preemptible task.  If other higher
priority task
 > are made ready while a PRIORITY_PSEUDO_ISR task preempts a not
preemptible
 > task, then the other tasks run before the not preemptible task. 
This made the

 > RTEMS_NO_PREEMPT mode ineffective.
 >
 > Remove the PRIORITY_PSEUDO_ISR special case logic.  This
simplifies the
 > uniprocessor schedulers.  Move the uniprocessor-specific
scheduler support to
 > the new header file .
 >
 > Close #2365.


I'm guessing that  PRIORITY_PSEUDO_ISR wasn't used outside RTEMS itself
and likely only historically for the Timer Server Thread. The protection 
for that
thread was reworked as part of the SMP efforts. If it is used outside 
RTEMS,

that would be a user facing breakage and should be documented.

If you think all the use cases of PRIORITY_PSEUDO_ISR are accounted for,
I'm ok with removing it.


The pseudo-interrupt priority is mentioned in a glossary entry:

priority boosting
A simple approach to extend the priority inheritance protocol for
clustered scheduling is priority boosting.  In case a mutex is 
owned by a
task of another cluster, then the priority of the owner task is 
raised to

an artificially high priority, the pseudo-interrupt priority.

This entry was added for the clustered scheduling documentation and 
needs to be changed.


I found no reference to the no-preempt break of the pseudo-interrupt 
priority in the documentation. I doubt that there is an application 
which relies on this extraordinary feature.


--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH] score: Remove PRIORITY_PSEUDO_ISR thread priority

2022-07-21 Thread Joel Sherrill
On Thu, Jul 21, 2022 at 12:53 AM Sebastian Huber <
sebastian.hu...@embedded-brains.de> wrote:

> Hello Gedare and Joel,
>
> On 15.07.22 10:43, Sebastian Huber wrote:
> > The uniprocessor schedulers had some special case logic for the
> > PRIORITY_PSEUDO_ISR priority.  Tasks with a priority of
> PRIORITY_PSEUDO_ISR
> > were allowed to preempt a not preemptible task.  If other higher
> priority task
> > are made ready while a PRIORITY_PSEUDO_ISR task preempts a not
> preemptible
> > task, then the other tasks run before the not preemptible task.  This
> made the
> > RTEMS_NO_PREEMPT mode ineffective.
> >
> > Remove the PRIORITY_PSEUDO_ISR special case logic.  This simplifies the
> > uniprocessor schedulers.  Move the uniprocessor-specific scheduler
> support to
> > the new header file .
> >
> > Close #2365.
>

I'm guessing that  PRIORITY_PSEUDO_ISR wasn't used outside RTEMS itself
and likely only historically for the Timer Server Thread. The protection
for that
thread was reworked as part of the SMP efforts. If it is used outside
RTEMS,
that would be a user facing breakage and should be documented.

If you think all the use cases of PRIORITY_PSEUDO_ISR are accounted for,
I'm ok with removing it.

>
> what is your opinion with respect to this change? It is the second last
> item on my score TODO list. The last item is:
>
> https://lists.rtems.org/pipermail/devel/2022-July/072534.html


I'll try to look at that today.

>
>
> --
> embedded brains GmbH
> Herr Sebastian HUBER
> Dornierstr. 4
> 82178 Puchheim
> Germany
> email: sebastian.hu...@embedded-brains.de
> phone: +49-89-18 94 741 - 16
> fax:   +49-89-18 94 741 - 08
>
> Registergericht: Amtsgericht München
> Registernummer: HRB 157899
> Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
> Unsere Datenschutzerklärung finden Sie hier:
> https://embedded-brains.de/datenschutzerklaerung/
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH] score: Remove PRIORITY_PSEUDO_ISR thread priority

2022-07-20 Thread Sebastian Huber

Hello Gedare and Joel,

On 15.07.22 10:43, Sebastian Huber wrote:

The uniprocessor schedulers had some special case logic for the
PRIORITY_PSEUDO_ISR priority.  Tasks with a priority of PRIORITY_PSEUDO_ISR
were allowed to preempt a not preemptible task.  If other higher priority task
are made ready while a PRIORITY_PSEUDO_ISR task preempts a not preemptible
task, then the other tasks run before the not preemptible task.  This made the
RTEMS_NO_PREEMPT mode ineffective.

Remove the PRIORITY_PSEUDO_ISR special case logic.  This simplifies the
uniprocessor schedulers.  Move the uniprocessor-specific scheduler support to
the new header file .

Close #2365.


what is your opinion with respect to this change? It is the second last 
item on my score TODO list. The last item is:


https://lists.rtems.org/pipermail/devel/2022-July/072534.html

--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

[PATCH] score: Remove PRIORITY_PSEUDO_ISR thread priority

2022-07-15 Thread Sebastian Huber
The uniprocessor schedulers had some special case logic for the
PRIORITY_PSEUDO_ISR priority.  Tasks with a priority of PRIORITY_PSEUDO_ISR
were allowed to preempt a not preemptible task.  If other higher priority task
are made ready while a PRIORITY_PSEUDO_ISR task preempts a not preemptible
task, then the other tasks run before the not preemptible task.  This made the
RTEMS_NO_PREEMPT mode ineffective.

Remove the PRIORITY_PSEUDO_ISR special case logic.  This simplifies the
uniprocessor schedulers.  Move the uniprocessor-specific scheduler support to
the new header file .

Close #2365.
---
 cpukit/include/rtems/posix/priorityimpl.h |   2 +-
 cpukit/include/rtems/score/priority.h |   7 -
 cpukit/include/rtems/score/scheduleredfimpl.h |  19 +-
 cpukit/include/rtems/score/schedulerimpl.h|  65 --
 .../rtems/score/schedulerpriorityimpl.h   |  30 +--
 .../include/rtems/score/schedulersimpleimpl.h |  22 +-
 cpukit/include/rtems/score/scheduleruniimpl.h | 221 ++
 cpukit/rtems/src/timerserver.c|   2 +-
 cpukit/score/src/mpci.c   |   2 +-
 cpukit/score/src/scheduleredfblock.c  |   4 +-
 cpukit/score/src/scheduleredfchangepriority.c |   5 +-
 cpukit/score/src/scheduleredfschedule.c   |   5 +-
 cpukit/score/src/scheduleredfunblock.c|  20 +-
 cpukit/score/src/scheduleredfyield.c  |   2 +-
 cpukit/score/src/schedulerpriorityblock.c |   4 +-
 .../src/schedulerprioritychangepriority.c |   5 +-
 cpukit/score/src/schedulerpriorityschedule.c  |   5 +-
 cpukit/score/src/schedulerpriorityunblock.c   |  16 +-
 cpukit/score/src/schedulerpriorityyield.c |   5 +-
 cpukit/score/src/schedulersimpleblock.c   |   4 +-
 .../score/src/schedulersimplechangepriority.c |   5 +-
 cpukit/score/src/schedulersimpleschedule.c|   5 +-
 cpukit/score/src/schedulersimpleunblock.c |  20 +-
 cpukit/score/src/schedulersimpleyield.c   |   5 +-
 spec/build/cpukit/librtemscpu.yml |   1 +
 testsuites/sptests/sptasknopreempt01/init.c   |  18 +-
 26 files changed, 295 insertions(+), 204 deletions(-)
 create mode 100644 cpukit/include/rtems/score/scheduleruniimpl.h

diff --git a/cpukit/include/rtems/posix/priorityimpl.h 
b/cpukit/include/rtems/posix/priorityimpl.h
index e391448372..ce26787294 100644
--- a/cpukit/include/rtems/posix/priorityimpl.h
+++ b/cpukit/include/rtems/posix/priorityimpl.h
@@ -84,7 +84,7 @@ RTEMS_INLINE_ROUTINE int _POSIX_Priority_Get_maximum(
  * Thus, SuperCore has priorities run in the opposite sense of the POSIX API.
  *
  * Let N be the maximum priority of this scheduler instance.   The SuperCore
- * priority zero is system reserved (PRIORITY_PSEUDO_ISR).  There are only
+ * priority zero is system reserved (PRIORITY_MINIMUM).  There are only
  * N - 1 POSIX API priority levels since a thread at SuperCore priority N would
  * never run because of the idle threads.  This is necessary because GNAT maps
  * the lowest Ada task priority to the lowest thread priority.  The lowest
diff --git a/cpukit/include/rtems/score/priority.h 
b/cpukit/include/rtems/score/priority.h
index 568e3c4e3e..6f6cc12bac 100644
--- a/cpukit/include/rtems/score/priority.h
+++ b/cpukit/include/rtems/score/priority.h
@@ -95,13 +95,6 @@ typedef uint64_t Priority_Control;
  */
 #define PRIORITY_MINIMUM  0
 
-/**
- * @brief The priority value of pseudo-ISR threads.
- *
- * Examples are the MPCI and timer server threads.
- */
-#define PRIORITY_PSEUDO_ISR   PRIORITY_MINIMUM
-
 /**
  * @brief The default lowest (least important) thread priority value.
  *
diff --git a/cpukit/include/rtems/score/scheduleredfimpl.h 
b/cpukit/include/rtems/score/scheduleredfimpl.h
index e0a07a8915..06a35ae95f 100644
--- a/cpukit/include/rtems/score/scheduleredfimpl.h
+++ b/cpukit/include/rtems/score/scheduleredfimpl.h
@@ -39,7 +39,7 @@
 #define _RTEMS_SCORE_SCHEDULEREDFIMPL_H
 
 #include 
-#include 
+#include 
 
 #ifdef __cplusplus
 extern "C" {
@@ -216,30 +216,23 @@ RTEMS_INLINE_ROUTINE void _Scheduler_EDF_Extract_body(
 }
 
 /**
- * @brief Schedules the next ready thread as the heir.
+ * @brief Gets the highest priority ready thread of the scheduler.
  *
- * @param scheduler The scheduler instance to schedule the minimum of the 
context of.
- * @param the_thread This parameter is not used.
- * @param force_dispatch Indicates whether the current heir is blocked even if 
it is
- *  not set as preemptible.
+ * @param scheduler is the scheduler.
  */
-RTEMS_INLINE_ROUTINE void _Scheduler_EDF_Schedule_body(
-  const Scheduler_Control *scheduler,
-  Thread_Control  *the_thread,
-  bool force_dispatch
+RTEMS_INLINE_ROUTINE Thread_Control *_Scheduler_EDF_Get_highest_ready(
+  const Scheduler_Control *scheduler
 )
 {
   Scheduler_EDF_Context *context;
   RBTree_Node   *first;
   Scheduler_EDF_Node*node;
 
-  (void) the_thread;
-
   context = _Scheduler_EDF_Get_context( scheduler );
   first =