summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/schedulersmp.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-10-29 09:30:13 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-11-23 11:00:28 +0100
commitfc64e837c3544c3462539237fec4e90726aa8727 (patch)
treeb496ba1164e5d48e7b58115d8978182ae12ed116 /cpukit/score/src/schedulersmp.c
parentscore: _Scheduler_SMP_Schedule_highest_ready() (diff)
downloadrtems-fc64e837c3544c3462539237fec4e90726aa8727.tar.bz2
score: Rework ask for help requests
Process ask for help requests on the current processor. This avoids using inter-processor interrupts to make the system behaviour a bit more predictable. Update #4531.
Diffstat (limited to 'cpukit/score/src/schedulersmp.c')
-rw-r--r--cpukit/score/src/schedulersmp.c29
1 files changed, 11 insertions, 18 deletions
diff --git a/cpukit/score/src/schedulersmp.c b/cpukit/score/src/schedulersmp.c
index cc566180b7..3bb2638139 100644
--- a/cpukit/score/src/schedulersmp.c
+++ b/cpukit/score/src/schedulersmp.c
@@ -21,28 +21,21 @@
#include <rtems/score/schedulersmpimpl.h>
-void _Scheduler_Request_ask_for_help( Thread_Control *the_thread )
+void _Scheduler_SMP_Remove_ask_for_help_from_processor(
+ Thread_Control *thread,
+ Per_CPU_Control *cpu
+)
{
- ISR_lock_Context scheduler_lock_context;
+ ISR_lock_Context lock_context;
- _Thread_Scheduler_acquire_critical( the_thread, &scheduler_lock_context );
+ _Assert( _ISR_lock_Is_owner( &thread->Scheduler.Lock ) );
- if ( _Chain_Is_node_off_chain( &the_thread->Scheduler.Help_node ) ) {
- Per_CPU_Control *cpu;
- ISR_lock_Context per_cpu_lock_context;
+ _Per_CPU_Acquire( cpu, &lock_context );
- cpu = _Thread_Get_CPU( the_thread );
- _Per_CPU_Acquire( cpu, &per_cpu_lock_context );
-
- _Chain_Append_unprotected(
- &cpu->Threads_in_need_for_help,
- &the_thread->Scheduler.Help_node
- );
-
- _Per_CPU_Release( cpu, &per_cpu_lock_context );
-
- _Thread_Dispatch_request( _Per_CPU_Get(), cpu );
+ if ( thread->Scheduler.ask_for_help_cpu == cpu ) {
+ _Chain_Extract_unprotected( &thread->Scheduler.Help_node );
+ thread->Scheduler.ask_for_help_cpu = NULL;
}
- _Thread_Scheduler_release_critical( the_thread, &scheduler_lock_context );
+ _Per_CPU_Release( cpu, &lock_context );
}