summaryrefslogtreecommitdiffstats
path: root/cpukit/include/rtems/score/threadimpl.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-10-15 11:21:31 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-11-23 11:00:28 +0100
commit3d6ebde1acab61e7c8fce1a1ed51517f7c2bf7c6 (patch)
tree53af30eda5f2f52317549afb9492b5a9f4cb7720 /cpukit/include/rtems/score/threadimpl.h
parentscore: Add SMP scheduler idle exchange callback (diff)
downloadrtems-3d6ebde1acab61e7c8fce1a1ed51517f7c2bf7c6.tar.bz2
score: Add SMP scheduler make/clean sticky
This patch fixes the following broken behaviour: While a thread is scheduled on a helping scheduler, while it does not own a MrsP semaphore, if it obtains a MrsP semaphore, then no scheduler node using an idle thread and the ceiling priority of the semaphore is unblocked for the home scheduler. This could lead to priority inversion issues and is not in line with the MrsP protocol. Introduce two new scheduler operations which are only enabled if RTEMS_SMP is defined. The operations are used to make the scheduler node of the home scheduler sticky and to clean the sticky property. This helps to keep the sticky handing out of the frequently used priority update operation. Close #4532.
Diffstat (limited to '')
-rw-r--r--cpukit/include/rtems/score/threadimpl.h28
1 files changed, 20 insertions, 8 deletions
diff --git a/cpukit/include/rtems/score/threadimpl.h b/cpukit/include/rtems/score/threadimpl.h
index 934b56468a..a55524cfd1 100644
--- a/cpukit/include/rtems/score/threadimpl.h
+++ b/cpukit/include/rtems/score/threadimpl.h
@@ -790,17 +790,29 @@ void _Thread_Priority_replace(
*/
void _Thread_Priority_update( Thread_queue_Context *queue_context );
+#if defined(RTEMS_SMP)
/**
- * @brief Updates the priority of the thread and changes it sticky level.
+ * @brief Updates the priority of the thread and makes its home scheduler node
+ * sticky.
*
- * @param the_thread The thread.
- * @param sticky_level_change The new value for the sticky level.
+ * @param the_thread is the thread to work on.
*/
-#if defined(RTEMS_SMP)
-void _Thread_Priority_and_sticky_update(
- Thread_Control *the_thread,
- int sticky_level_change
-);
+void _Thread_Priority_update_and_make_sticky( Thread_Control *the_thread );
+
+/**
+ * @brief Updates the priority of the thread and cleans the sticky property of
+ * its home scheduler node.
+ *
+ * @param the_thread is the thread to work on.
+ */
+void _Thread_Priority_update_and_clean_sticky( Thread_Control *the_thread );
+
+/**
+ * @brief Updates the priority of the thread.
+ *
+ * @param the_thread is the thread to update the priority.
+ */
+void _Thread_Priority_update_ignore_sticky( Thread_Control *the_thread );
#endif
/**