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/posix/src/pthreadgetschedparam.c | |
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 'cpukit/posix/src/pthreadgetschedparam.c')
-rw-r--r-- | cpukit/posix/src/pthreadgetschedparam.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/cpukit/posix/src/pthreadgetschedparam.c b/cpukit/posix/src/pthreadgetschedparam.c index a82d79c715..406ae8e7bb 100644 --- a/cpukit/posix/src/pthreadgetschedparam.c +++ b/cpukit/posix/src/pthreadgetschedparam.c @@ -37,11 +37,11 @@ int pthread_getschedparam( struct sched_param *param ) { - Thread_Control *the_thread; - Thread_queue_Context queue_context; - Thread_CPU_budget_algorithms budget_algorithm; - const Scheduler_Control *scheduler; - Priority_Control priority; + Thread_Control *the_thread; + Thread_queue_Context queue_context; + const Thread_CPU_budget_operations *cpu_budget_operations; + const Scheduler_Control *scheduler; + Priority_Control priority; if ( policy == NULL || param == NULL ) { return EINVAL; @@ -59,11 +59,11 @@ int pthread_getschedparam( scheduler = _Thread_Scheduler_get_home( the_thread ); _POSIX_Threads_Get_sched_param_sporadic( the_thread, scheduler, param ); priority = the_thread->Real_priority.priority; - budget_algorithm = the_thread->budget_algorithm; + cpu_budget_operations = the_thread->CPU_budget.operations; _Thread_Wait_release( the_thread, &queue_context ); param->sched_priority = _POSIX_Priority_From_core( scheduler, priority ); - *policy = _POSIX_Thread_Translate_to_sched_policy( budget_algorithm ); + *policy = _POSIX_Thread_Translate_to_sched_policy( cpu_budget_operations ); return 0; } |