summaryrefslogtreecommitdiffstats
path: root/testsuites/smptests/smpscheduler03
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-02-02 16:24:05 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-02-03 10:17:38 +0100
commitca1e546e7772838b20d0792155e2c71514d6b5d3 (patch)
treea5af2d74d6fcefa8d36f0fa32debd886e63cca4b /testsuites/smptests/smpscheduler03
parentsparc: Fix volatile clobber (diff)
downloadrtems-ca1e546e7772838b20d0792155e2c71514d6b5d3.tar.bz2
score: Improve scheduler helping protocol
Only register ask for help requests in the scheduler unblock and yield operations. The actual ask for help operation is carried out during _Thread_Do_dispatch() on a processor related to the thread. This yields a better separation of scheduler instances. A thread of one scheduler instance should not be forced to carry out too much work for threads on other scheduler instances. Update #2556.
Diffstat (limited to 'testsuites/smptests/smpscheduler03')
-rw-r--r--testsuites/smptests/smpscheduler03/init.c26
1 files changed, 6 insertions, 20 deletions
diff --git a/testsuites/smptests/smpscheduler03/init.c b/testsuites/smptests/smpscheduler03/init.c
index 51098b6f61..e4aa9855bd 100644
--- a/testsuites/smptests/smpscheduler03/init.c
+++ b/testsuites/smptests/smpscheduler03/init.c
@@ -315,7 +315,7 @@ static void test_update_priority_op(void)
rtems_test_assert(sc == RTEMS_SUCCESSFUL);
}
-static bool yield_op(
+static void yield_op(
Thread_Control *thread,
Scheduler_SMP_Node *scheduler_node
)
@@ -323,13 +323,12 @@ static bool yield_op(
const Scheduler_Control *scheduler;
ISR_lock_Context state_lock_context;
ISR_lock_Context scheduler_lock_context;
- bool needs_help;
_Thread_State_acquire( thread, &state_lock_context );
scheduler = _Thread_Scheduler_get_home( thread );
_Scheduler_Acquire_critical( scheduler, &scheduler_lock_context );
- needs_help = (*scheduler->Operations.yield)(
+ (*scheduler->Operations.yield)(
scheduler,
thread,
&scheduler_node->Base
@@ -337,8 +336,6 @@ static bool yield_op(
_Scheduler_Release_critical( scheduler, &scheduler_lock_context );
_Thread_State_release( thread, &state_lock_context );
-
- return needs_help;
}
static void test_case_yield_op(
@@ -349,7 +346,6 @@ static void test_case_yield_op(
Scheduler_SMP_Node_state new_state
)
{
- bool needs_help;
Per_CPU_Control *cpu_self;
cpu_self = _Thread_Dispatch_disable();
@@ -393,15 +389,12 @@ static void test_case_yield_op(
}
rtems_test_assert(executing_node->state == start_state);
- needs_help = yield_op(executing, executing_node);
+ yield_op(executing, executing_node);
rtems_test_assert(executing_node->state == new_state);
switch (new_state) {
case SCHEDULER_SMP_NODE_SCHEDULED:
- rtems_test_assert(!needs_help);
- break;
case SCHEDULER_SMP_NODE_READY:
- rtems_test_assert(needs_help);
break;
default:
rtems_test_assert(0);
@@ -470,7 +463,7 @@ static void block_op(
_Thread_State_release( thread, &state_lock_context );
}
-static bool unblock_op(
+static void unblock_op(
Thread_Control *thread,
Scheduler_SMP_Node *scheduler_node
)
@@ -478,13 +471,12 @@ static bool unblock_op(
const Scheduler_Control *scheduler;
ISR_lock_Context state_lock_context;
ISR_lock_Context scheduler_lock_context;
- bool needs_help;
_Thread_State_acquire( thread, &state_lock_context );
scheduler = _Thread_Scheduler_get_home( thread );
_Scheduler_Acquire_critical( scheduler, &scheduler_lock_context );
- needs_help = (*scheduler->Operations.unblock)(
+ (*scheduler->Operations.unblock)(
scheduler,
thread,
&scheduler_node->Base
@@ -492,8 +484,6 @@ static bool unblock_op(
_Scheduler_Release_critical( scheduler, &scheduler_lock_context );
_Thread_State_release( thread, &state_lock_context );
-
- return needs_help;
}
static void test_case_unblock_op(
@@ -503,7 +493,6 @@ static void test_case_unblock_op(
Scheduler_SMP_Node_state new_state
)
{
- bool needs_help;
Per_CPU_Control *cpu_self;
cpu_self = _Thread_Dispatch_disable();
@@ -525,15 +514,12 @@ static void test_case_unblock_op(
block_op(executing, executing_node);
rtems_test_assert(executing_node->state == SCHEDULER_SMP_NODE_BLOCKED);
- needs_help = unblock_op(executing, executing_node);
+ unblock_op(executing, executing_node);
rtems_test_assert(executing_node->state == new_state);
switch (new_state) {
case SCHEDULER_SMP_NODE_SCHEDULED:
- rtems_test_assert(!needs_help);
- break;
case SCHEDULER_SMP_NODE_READY:
- rtems_test_assert(needs_help);
break;
default:
rtems_test_assert(0);