diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-10-27 12:59:09 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-11-15 08:56:53 +0100 |
commit | 240a1f79b1fcb58b9ae7bfc393e1f890e4492683 (patch) | |
tree | 92c47fa4899b2f0a8306e32bc18d66fbbf6b216f /cpukit/include/rtems/rtems/modesimpl.h | |
parent | score: Do not shadow parameter (diff) | |
download | rtems-240a1f79b1fcb58b9ae7bfc393e1f890e4492683.tar.bz2 |
score: Introduce CPU budget operations
This patch set replaces the CPU budget algorithm enumeration with a set of CPU
budget operations which implement a particular CPU budget algorithm. This
helps to hide the CPU budget algorithm implementation details from the general
thread handling. The CPU budget callouts are turned into CPU budget
operations. This slightly reduces the size of the thread control block.
All schedulers used the default scheduler tick implementation. The tick
scheduler operation is removed and the CPU budget operations are directly used
in _Watchdog_Tick() if the executing thread uses a CPU budget algorithm. This
is performance improvement for all threads which do not use a CPU budget
algorithm (default behaviour).
Diffstat (limited to '')
-rw-r--r-- | cpukit/include/rtems/rtems/modesimpl.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/cpukit/include/rtems/rtems/modesimpl.h b/cpukit/include/rtems/rtems/modesimpl.h index 924e12fbee..8fdab263f1 100644 --- a/cpukit/include/rtems/rtems/modesimpl.h +++ b/cpukit/include/rtems/rtems/modesimpl.h @@ -22,6 +22,7 @@ #include <rtems/score/schedulerimpl.h> #include <rtems/score/smpimpl.h> #include <rtems/score/threadimpl.h> +#include <rtems/score/threadcpubudget.h> #include <rtems/config.h> #ifdef __cplusplus @@ -148,10 +149,11 @@ RTEMS_INLINE_ROUTINE void _Modes_Apply_timeslice_to_thread( ) { if ( _Modes_Is_timeslice( mode_set ) ) { - the_thread->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; - the_thread->cpu_time_budget = rtems_configuration_get_ticks_per_timeslice(); + the_thread->CPU_budget.operations = &_Thread_CPU_budget_reset_timeslice; + the_thread->CPU_budget.available = + rtems_configuration_get_ticks_per_timeslice(); } else { - the_thread->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; + the_thread->CPU_budget.operations = NULL; } } |