-
-
Notifications
You must be signed in to change notification settings - Fork 606
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lazy stack: do nothing in kernel threads and on populated stack
This patch annotates the relevant call sites with the invariant assert expressions to validate assumptions that let us do "nothing" in all these cases. We also reorganize some code in the scheduler to help differentiate between cases when given function/method is called with interrupts or preemption disabled or from kernel thread or by interrupt handler. Following methods get added to scheduler code with names describing state of interrupts or preemption or kernel caller: - timer_base::set_with_irq_disabled(osv::clock::uptime::time_point time) - timer_base::set_with_irq_disabled(std::chrono::duration<Rep, Period> duration) - thread::wake_with_irq_disabled() - thread::wake_with_irq_or_preemption_disabled(Action action) - thread_handle::wake_from_kernel_or_with_irq_disabled() In general: - we modify all interrupt handlers (those that are executed on interrupt stack) to call one of the 3 new wake_...() methods (mostly wake_with_irq_disabled()) to indicate we do not need/should not pre-fault the stack; most of those are in device drivers code - we modify all code executed on kernel threads that disables preemption or interrupts by adding relevant invariant - assert(!sched::thread::current()->is_app()); we do not need to pre-fault because the stack is populated - we also modify the code whhich is indirectly called from kernel threads like classifier::post_packet() in net channels - finally we also modify the scheduler code to use timer_bas::set_with_irq_disabled() mostly around preemption_timer to indicate that we should not pre-fault the stack downstream Signed-off-by: Waldemar Kozaczuk <[email protected]>
- Loading branch information
Showing
32 changed files
with
157 additions
and
39 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.