[rtems-central commit] spec: Add a test scenario with a sticky node

Sebastian Huber sebh at rtems.org
Fri Nov 12 09:22:15 UTC 2021


Module:    rtems-central
Branch:    master
Commit:    19f078f5876ca3358f0d751a83c46dd694b736ce
Changeset: http://git.rtems.org/rtems-central/commit/?id=19f078f5876ca3358f0d751a83c46dd694b736ce

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Nov 11 20:04:38 2021 +0100

spec: Add a test scenario with a sticky node

---

 spec/score/sched/smp/val/smp.yml | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/spec/score/sched/smp/val/smp.yml b/spec/score/sched/smp/val/smp.yml
index ed5dce8..92fef21 100644
--- a/spec/score/sched/smp/val/smp.yml
+++ b/spec/score/sched/smp/val/smp.yml
@@ -186,6 +186,29 @@ test-actions:
   links: []
 - action-brief: |
     Construct a system state in which a scheduler tries to schedule a node
+    those owner thread is already scheduled during a set priority operation
+    while a sticky node is involved.
+  action-code: |
+    PrepareOwnerScheduled( ctx );
+  checks:
+  - brief: |
+      Set the priority of the runner thread while the owner thread of the
+      highest priority ready node is already scheduled.
+    code: |
+      MakeSticky( ctx );
+      CallWithinISR( RaiseWorkerPriorityWithIdleRunner, ctx );
+      CleanSticky( ctx );
+    links:
+    - role: validation
+      uid: ../req/ask-for-help-home
+  - brief: |
+      Clean up all used resources.
+    code: |
+      CleanupOwnerScheduled( ctx );
+    links: []
+  links: []
+- action-brief: |
+    Construct a system state in which a scheduler tries to schedule a node
     those owner thread is blocked during a set priority operation.
   action-code: |
     PrepareOwnerBlocked( ctx );
@@ -606,6 +629,18 @@ test-support: |
     }
   }
 
+  static void RaiseWorkerPriorityWithIdleRunner( void *arg )
+  {
+    Context *ctx;
+
+    ctx = arg;
+    SuspendTask( ctx->runner_id );
+    T_scheduler_set_event_handler( UpdatePriorityStopBusyC, ctx );
+    SetPriority( ctx->worker_id[ WORKER_A ], PRIO_HIGH );
+    SetPriority( ctx->worker_id[ WORKER_A ], PRIO_NORMAL );
+    ResumeTask( ctx->runner_id );
+  }
+
   static void PrepareOwnerScheduled( Context *ctx )
   {
     SetScheduler( ctx->worker_id[ WORKER_B ], SCHEDULER_B_ID, PRIO_NORMAL );



More information about the vc mailing list