kernel/scheduler: Reset the invoke_scheduler flag on reschedule.
There is nowhere else that unsets it (or makes sense to unset it), we have to do it here, or otherwise it will never be unset. This has actually been broken since the new scheduler was merged many years ago; the old scheduler (which had more complex logic here) unset this flag correctly. This oversight mostly did not cause obvious problems: while the scheduler would be invoked unnecessarily on every single interrupt, that would be a minor performance downturn at most. But there is one other effect: since we can only reenable interrupts after invoking the scheduler, "post_interrupt_callback"s of threads were not invoked most of the time. The main user of "post_interrupt_callback"s is the profiler, which uses them to trigger buffer flushes back to userland. Since they were not invoked, the buffer would quickly fill up and then no more results would be recorded. Thus, this fixes #16345.
This commit is contained in:
parent
094079b8c5
commit
644fa4bf7b
@ -319,6 +319,7 @@ reschedule(int32 nextState)
|
||||
SCHEDULER_ENTER_FUNCTION();
|
||||
|
||||
int32 thisCPU = smp_get_current_cpu();
|
||||
gCPU[thisCPU].invoke_scheduler = false;
|
||||
|
||||
CPUEntry* cpu = CPUEntry::GetCPU(thisCPU);
|
||||
CoreEntry* core = CoreEntry::GetCore(thisCPU);
|
||||
|
Loading…
x
Reference in New Issue
Block a user