diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-11-09 16:21:37 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-11-20 08:36:49 +0100 |
commit | c597fb166e05d315ce5da29c0a43a09992772dad (patch) | |
tree | 627d3f248020e0a292fe7dcb2505cf4d90957ae7 /cpukit/score/include/rtems/score/priority.h | |
parent | bsps/powerpc: Fix PPC_EXC_CONFIG_USE_FIXED_HANDLER (diff) | |
download | rtems-c597fb166e05d315ce5da29c0a43a09992772dad.tar.bz2 |
score: Optimize scheduler priority updates
Thread priority changes may append or prepend the thread to its priority
group on the scheduler ready queue. Previously, a separate priority
value and a prepend-it flag in the scheduler node were used to propagate
a priority change to the scheduler.
Now, use an append-it bit in the priority control and reduce the plain
priority value to 63 bits.
This change leads to a significant code size reduction (about 25%) of
the SMP schedulers. The negligible increase of the standard priority
scheduler is due to some additional shift operations
(SCHEDULER_PRIORITY_MAP() and SCHEDULER_PRIORITY_UNMAP()).
Before:
text filename
136 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulersimpleblock.o
464 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulersimplechangepriority.o
24 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulersimple.o
108 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulersimpleschedule.o
292 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulersimpleunblock.o
264 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulersimpleyield.o
text filename
280 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulerpriorityblock.o
488 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulerprioritychangepriority.o
200 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulerpriority.o
164 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulerpriorityschedule.o
328 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulerpriorityunblock.o
200 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulerpriorityyield.o
text filename
24112 arm-rtems5/c/imx7/cpukit/score/src/libscore_a-scheduleredfsmp.o
text filename
37204 sparc-rtems5/c/gr740/cpukit/score/src/libscore_a-scheduleredfsmp.o
text filename
42236 powerpc-rtems5/c/qoriq_e6500_32/cpukit/score/src/libscore_a-scheduleredfsmp.o
After:
text filename
136 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulersimpleblock.o
272 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulersimplechangepriority.o
24 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulersimple.o
108 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulersimpleschedule.o
292 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulersimpleunblock.o
264 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulersimpleyield.o
text filename
280 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulerpriorityblock.o
488 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulerprioritychangepriority.o
208 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulerpriority.o
164 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulerpriorityschedule.o
332 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulerpriorityunblock.o
200 sparc-rtems5/c/erc32/cpukit/score/src/libscore_a-schedulerpriorityyield.o
text filename
18860 arm-rtems5/c/imx7/cpukit/score/src/libscore_a-scheduleredfsmp.o
text filename
28520 sparc-rtems5/c/gr740/cpukit/score/src/libscore_a-scheduleredfsmp.o
text filename
32664 powerpc-rtems5/c/qoriq_e6500_32/cpukit/score/src/libscore_a-scheduleredfsmp.o
Diffstat (limited to 'cpukit/score/include/rtems/score/priority.h')
-rw-r--r-- | cpukit/score/include/rtems/score/priority.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/cpukit/score/include/rtems/score/priority.h b/cpukit/score/include/rtems/score/priority.h index 9cc6338288..7a8ddba763 100644 --- a/cpukit/score/include/rtems/score/priority.h +++ b/cpukit/score/include/rtems/score/priority.h @@ -8,7 +8,7 @@ * COPYRIGHT (c) 1989-2011. * On-Line Applications Research Corporation (OAR). * - * Copyright (c) 2016 embedded brains GmbH. + * Copyright (c) 2016, 2017 embedded brains GmbH. * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at @@ -45,11 +45,23 @@ extern "C" { */ /** - * @brief A plain thread priority value. + * @brief The thread priority control. * * Lower values represent higher priorities. So, a priority value of zero * represents the highest priority thread. This value is reserved for internal * threads and the priority ceiling protocol. + * + * The format of the thread priority control depends on the context. A thread + * priority control may contain a user visible priority for API import/export. + * It may also contain a scheduler internal priority value. Values are + * translated via the scheduler map/unmap priority operations. The format of + * scheduler interal values depend on the particular scheduler implementation. + * It may for example encode a deadline in case of the EDF scheduler. + * + * The thread priority control value contained in the scheduler node + * (Scheduler_Node::Priority::value) uses the least-significant bit to indicate + * if the thread should be appended or prepended to its priority group, see + * SCHEDULER_PRIORITY_APPEND(). */ typedef uint64_t Priority_Control; |