[PATCH v1] score:fix smp priority affinity scheduler yeild problem

tianye at sugon.com tianye at sugon.com
Thu May 12 02:48:55 UTC 2022


From: Tian Ye <tianye at sugon.com>

---
 .../rtems/score/schedulerpriorityaffinitysmp.h |  7 ++++++-
 .../score/src/schedulerpriorityaffinitysmp.c   | 18 ++++++++++++++++++
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/cpukit/include/rtems/score/schedulerpriorityaffinitysmp.h b/cpukit/include/rtems/score/schedulerpriorityaffinitysmp.h
index 498ffcb7aa..bac3ad786e 100644
--- a/cpukit/include/rtems/score/schedulerpriorityaffinitysmp.h
+++ b/cpukit/include/rtems/score/schedulerpriorityaffinitysmp.h
@@ -54,7 +54,7 @@ extern "C" {
   { \
     _Scheduler_priority_SMP_Initialize, \
     _Scheduler_default_Schedule, \
-    _Scheduler_priority_SMP_Yield, \
+    _Scheduler_priority_affinity_SMP_Yield, \
     _Scheduler_priority_affinity_SMP_Block, \
     _Scheduler_priority_affinity_SMP_Unblock, \
     _Scheduler_priority_affinity_SMP_Update_priority, \
@@ -107,6 +107,11 @@ void _Scheduler_priority_affinity_SMP_Block(
   Scheduler_Node          *node
 );
 
+void _Scheduler_priority_affinity_SMP_Yield(
+  const Scheduler_Control *scheduler,
+  Thread_Control          *thread,
+  Scheduler_Node          *node
+);
 /**
  * @brief Unblocks a thread.
  *
diff --git a/cpukit/score/src/schedulerpriorityaffinitysmp.c b/cpukit/score/src/schedulerpriorityaffinitysmp.c
index 86ef7bf83e..d59917340d 100644
--- a/cpukit/score/src/schedulerpriorityaffinitysmp.c
+++ b/cpukit/score/src/schedulerpriorityaffinitysmp.c
@@ -576,3 +576,21 @@ bool _Scheduler_priority_affinity_SMP_Set_affinity(
 
   return true;
 }
+
+void _Scheduler_priority_affinity_SMP_Yield(
+  const Scheduler_Control *scheduler,
+  Thread_Control          *thread,
+  Scheduler_Node          *node
+)
+{
+  Scheduler_Context *context = _Scheduler_Get_context( scheduler );
+
+  _Scheduler_SMP_Yield(
+    context,
+    thread,
+    node,
+    _Scheduler_priority_SMP_Extract_from_ready,
+    _Scheduler_priority_affinity_SMP_Enqueue,
+    _Scheduler_priority_affinity_SMP_Enqueue_scheduled
+  );
+}
-- 
2.25.1



More information about the devel mailing list