Repository navigation
Fix/priority preemption - #22
Merged
Merged
Conversation
- a process now keeps the CPU until it blocks, waits, yields, or a strictly higher priority becomes READY; the per-tick rotation to equal and lower priorities is gone - dispatch: preempt only for a strictly higher priority and put the preempted process at the head of its queue; the new maxrtos_kernel_dispatch_yield lets an equal priority take over and queues the caller at the tail - partition: add maxrtos_partition_yield beside maxrtos_partition_dispatch; maxrtos_kernel_yield uses it - scheduler: add inline enqueue_front, pop and has_higher; the dispatch finds the best priority once instead of twice - svc: after a call that can ready a process, preempt the caller if a higher priority is now READY; the check skips a caller that blocked - svc: timed_wait( 0 ) is a rescheduling point, same as yield - restart: a restarted process queues behind its equal-priority peers - docs: describe the dispatch rules in the headers - clang-format also reflowed existing lines in partition.c
- unit: add test_priority (preemption, yield, head requeue, wake-up checks) and test_support.h with test_run_as; port the buffer, mutex, semaphore, dispatch, partition, tick and timing tests off the old rotation - sil: add test_process_priority; the busy workers in the fault, spatial and privilege tests now yield so restarted peers run - qemu: add the priority test and its module_priority.json - hil: add the priority test; rewrite context_integrity so a waking high-priority process interrupts the spinners instead of relying on time slicing - context_integrity.S: align the 8-byte spin loop so it cannot straddle a 32-byte flash line; unaligned it ran 20 times slower - clang-format also reflowed existing lines in the ported tests
- bench_context_switch: remove the TICK_ROTATE sample, since a tick within a partition switches nothing now; only partition-switch ticks are recorded - run_bench.py: report YIELD, TICK_SWITCH, QUEUE_HANDOFF and MUTEX_HANDOFF - README: describe the remaining samples - RESULTS: figures at 480 MHz and 64 MHz, caches on and off
- next_id was set to MAXRTOS_INVALID_PROCESS_ID and then overwritten before any read, which cppcheck reports as unreadVariable and fails the MISRA job - declare it in the block that uses it - checked with cppcheck 2.20.0 and its misra.py, exit 0 - clang-format run on dispatch.c
- add maxrtos_arch_fatal(), a weak function that halts by default (MAXRTOS_PORT_HALT); an application defines its own to log and reset, or to let a watchdog it configures expire - call it where the kernel cannot continue: an unattributable HardFault, a failure in the fault-recovery path, and an invalid syscall gate; the HardFault case used to spin in an empty loop - the kernel owns no watchdog; the README says to configure one and feed it from the application - qemu: add emu_fatal_hook, where a BKPT reaches the application's own hook; add emu_finish() to the harness for code that runs where the per-tick poll cannot - clang-format also reflowed existing lines in fault_handlers.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.