forked from Imagelibrary/seL4
kernel: attempt direct switch on set prio
Prior to this commit the kernel would always trigger a full reschedule on setPriority. This change allows the kernel to attempt a direct switch, avoiding invoking the scheduler. - Move location of setPriority call to after any cap deletion This makes the proof easier as setPriority now changes ksSchedulerAction, which is required to be ResumeCurrentThread or ChooseNewThread by the cap delete functions. - Update to attempt direct switch on set prio.
This commit is contained in:
@@ -525,8 +525,11 @@ void setPriority(tcb_t *tptr, prio_t prio)
|
||||
tcbSchedDequeue(tptr);
|
||||
tptr->tcbPriority = prio;
|
||||
if (isRunnable(tptr)) {
|
||||
SCHED_ENQUEUE(tptr);
|
||||
rescheduleRequired();
|
||||
if (tptr == NODE_STATE(ksCurThread)) {
|
||||
rescheduleRequired();
|
||||
} else {
|
||||
possibleSwitchTo(tptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1735,10 +1735,6 @@ exception_t invokeTCB_ThreadControl(tcb_t *target, cte_t *slot,
|
||||
setMCPriority(target, mcp);
|
||||
}
|
||||
|
||||
if (updateFlags & thread_control_update_priority) {
|
||||
setPriority(target, priority);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_KERNEL_MCS
|
||||
if (updateFlags & thread_control_update_sc) {
|
||||
if (sc != NULL && sc != target->tcbSchedContext) {
|
||||
@@ -1823,6 +1819,10 @@ exception_t invokeTCB_ThreadControl(tcb_t *target, cte_t *slot,
|
||||
}
|
||||
}
|
||||
|
||||
if (updateFlags & thread_control_update_priority) {
|
||||
setPriority(target, priority);
|
||||
}
|
||||
|
||||
return EXCEPTION_NONE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user