summaryrefslogtreecommitdiffstats
path: root/cpukit/include/rtems/posix
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-10-27 12:59:09 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-11-15 08:56:53 +0100
commit240a1f79b1fcb58b9ae7bfc393e1f890e4492683 (patch)
tree92c47fa4899b2f0a8306e32bc18d66fbbf6b216f /cpukit/include/rtems/posix
parentscore: Do not shadow parameter (diff)
downloadrtems-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 'cpukit/include/rtems/posix')
-rw-r--r--cpukit/include/rtems/posix/pthreadimpl.h15
1 files changed, 4 insertions, 11 deletions
diff --git a/cpukit/include/rtems/posix/pthreadimpl.h b/cpukit/include/rtems/posix/pthreadimpl.h
index 723b20e8d2..0dc7d9dac5 100644
--- a/cpukit/include/rtems/posix/pthreadimpl.h
+++ b/cpukit/include/rtems/posix/pthreadimpl.h
@@ -47,7 +47,7 @@ RTEMS_INLINE_ROUTINE void _POSIX_Threads_Sporadic_timer_insert(
POSIX_API_Control *api
)
{
- the_thread->cpu_time_budget =
+ the_thread->CPU_budget.available =
_Timespec_To_ticks( &api->Sporadic.sched_ss_init_budget );
_Watchdog_Per_CPU_insert_ticks(
@@ -61,19 +61,12 @@ RTEMS_INLINE_ROUTINE void _POSIX_Threads_Sporadic_timer_insert(
void _POSIX_Threads_Sporadic_timer( Watchdog_Control *watchdog );
/**
- * @brief POSIX threads sporadic budget callout.
- *
- * This routine handles the sporadic scheduling algorithm.
- *
- * @param[in] the_thread is a pointer to the thread whose budget
- * has been exceeded.
+ * @brief The POSIX threads sporadic budget operations.
*/
-void _POSIX_Threads_Sporadic_budget_callout(
- Thread_Control *the_thread
-);
+extern const Thread_CPU_budget_operations _POSIX_Threads_Sporadic_budget;
int _POSIX_Thread_Translate_to_sched_policy(
- Thread_CPU_budget_algorithms budget_algorithm
+ const Thread_CPU_budget_operations *operations
);
/**