kernel: Remove invoke_scheduler_if_idle
This commit is contained in:
@@ -71,7 +71,6 @@ typedef struct cpu_ent {
|
|||||||
Thread* running_thread;
|
Thread* running_thread;
|
||||||
Thread* previous_thread;
|
Thread* previous_thread;
|
||||||
bool invoke_scheduler;
|
bool invoke_scheduler;
|
||||||
bool invoke_scheduler_if_idle;
|
|
||||||
bool disabled;
|
bool disabled;
|
||||||
|
|
||||||
// CPU topology information
|
// CPU topology information
|
||||||
|
|||||||
@@ -22,8 +22,7 @@ enum {
|
|||||||
SMP_MSG_GLOBAL_INVALIDATE_PAGES,
|
SMP_MSG_GLOBAL_INVALIDATE_PAGES,
|
||||||
SMP_MSG_CPU_HALT,
|
SMP_MSG_CPU_HALT,
|
||||||
SMP_MSG_CALL_FUNCTION,
|
SMP_MSG_CALL_FUNCTION,
|
||||||
SMP_MSG_RESCHEDULE,
|
SMP_MSG_RESCHEDULE
|
||||||
SMP_MSG_RESCHEDULE_IF_IDLE
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
|||||||
@@ -656,10 +656,9 @@ affine_enqueue(Thread* thread, bool newOne)
|
|||||||
// reschedule anyway and update its heap key to the correct value.
|
// reschedule anyway and update its heap key to the correct value.
|
||||||
affine_update_priority_heaps(targetCPU, threadPriority);
|
affine_update_priority_heaps(targetCPU, threadPriority);
|
||||||
|
|
||||||
if (targetCPU == smp_get_current_cpu()) {
|
if (targetCPU == smp_get_current_cpu())
|
||||||
gCPU[targetCPU].invoke_scheduler = true;
|
gCPU[targetCPU].invoke_scheduler = true;
|
||||||
gCPU[targetCPU].invoke_scheduler_if_idle = false;
|
else {
|
||||||
} else {
|
|
||||||
smp_send_ici(targetCPU, SMP_MSG_RESCHEDULE, 0, 0, 0, NULL,
|
smp_send_ici(targetCPU, SMP_MSG_RESCHEDULE, 0, 0, 0, NULL,
|
||||||
SMP_MSG_FLAG_ASYNC);
|
SMP_MSG_FLAG_ASYNC);
|
||||||
}
|
}
|
||||||
@@ -840,7 +839,6 @@ reschedule_event(timer *unused)
|
|||||||
|
|
||||||
thread->scheduler_data->lost_cpu = true;
|
thread->scheduler_data->lost_cpu = true;
|
||||||
thread->cpu->invoke_scheduler = true;
|
thread->cpu->invoke_scheduler = true;
|
||||||
thread->cpu->invoke_scheduler_if_idle = false;
|
|
||||||
thread->cpu->preempted = 1;
|
thread->cpu->preempted = 1;
|
||||||
return B_HANDLED_INTERRUPT;
|
return B_HANDLED_INTERRUPT;
|
||||||
}
|
}
|
||||||
@@ -960,17 +958,6 @@ affine_reschedule(void)
|
|||||||
{
|
{
|
||||||
Thread* oldThread = thread_get_current_thread();
|
Thread* oldThread = thread_get_current_thread();
|
||||||
|
|
||||||
// check whether we're only supposed to reschedule, if the current thread
|
|
||||||
// is idle
|
|
||||||
if (oldThread->cpu->invoke_scheduler) {
|
|
||||||
oldThread->cpu->invoke_scheduler = false;
|
|
||||||
if (oldThread->cpu->invoke_scheduler_if_idle
|
|
||||||
&& oldThread->priority != B_IDLE_PRIORITY) {
|
|
||||||
oldThread->cpu->invoke_scheduler_if_idle = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int32 thisCPU = smp_get_current_cpu();
|
int32 thisCPU = smp_get_current_cpu();
|
||||||
int32 thisCore = sCPUToCore[thisCPU];
|
int32 thisCore = sCPUToCore[thisCPU];
|
||||||
|
|
||||||
|
|||||||
@@ -323,10 +323,9 @@ simple_enqueue(Thread* thread, bool newOne)
|
|||||||
// reschedule anyway and update its heap key to the correct value.
|
// reschedule anyway and update its heap key to the correct value.
|
||||||
sCPUHeap->ModifyKey(&sCPUEntries[targetCPU], threadPriority);
|
sCPUHeap->ModifyKey(&sCPUEntries[targetCPU], threadPriority);
|
||||||
|
|
||||||
if (targetCPU == smp_get_current_cpu()) {
|
if (targetCPU == smp_get_current_cpu())
|
||||||
gCPU[targetCPU].invoke_scheduler = true;
|
gCPU[targetCPU].invoke_scheduler = true;
|
||||||
gCPU[targetCPU].invoke_scheduler_if_idle = false;
|
else {
|
||||||
} else {
|
|
||||||
smp_send_ici(targetCPU, SMP_MSG_RESCHEDULE, 0, 0, 0, NULL,
|
smp_send_ici(targetCPU, SMP_MSG_RESCHEDULE, 0, 0, 0, NULL,
|
||||||
SMP_MSG_FLAG_ASYNC);
|
SMP_MSG_FLAG_ASYNC);
|
||||||
}
|
}
|
||||||
@@ -428,7 +427,6 @@ reschedule_event(timer* /* unused */)
|
|||||||
|
|
||||||
thread->scheduler_data->lost_cpu = true;
|
thread->scheduler_data->lost_cpu = true;
|
||||||
thread->cpu->invoke_scheduler = true;
|
thread->cpu->invoke_scheduler = true;
|
||||||
thread->cpu->invoke_scheduler_if_idle = false;
|
|
||||||
thread->cpu->preempted = 1;
|
thread->cpu->preempted = 1;
|
||||||
return B_HANDLED_INTERRUPT;
|
return B_HANDLED_INTERRUPT;
|
||||||
}
|
}
|
||||||
@@ -547,17 +545,6 @@ simple_reschedule(void)
|
|||||||
{
|
{
|
||||||
Thread* oldThread = thread_get_current_thread();
|
Thread* oldThread = thread_get_current_thread();
|
||||||
|
|
||||||
// check whether we're only supposed to reschedule, if the current thread
|
|
||||||
// is idle
|
|
||||||
if (oldThread->cpu->invoke_scheduler) {
|
|
||||||
oldThread->cpu->invoke_scheduler = false;
|
|
||||||
if (oldThread->cpu->invoke_scheduler_if_idle
|
|
||||||
&& oldThread->priority != B_IDLE_PRIORITY) {
|
|
||||||
oldThread->cpu->invoke_scheduler_if_idle = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int32 thisCPU = smp_get_current_cpu();
|
int32 thisCPU = smp_get_current_cpu();
|
||||||
|
|
||||||
TRACE("reschedule(): cpu %ld, current thread = %ld\n", thisCPU,
|
TRACE("reschedule(): cpu %ld, current thread = %ld\n", thisCPU,
|
||||||
|
|||||||
@@ -740,16 +740,6 @@ process_pending_ici(int32 currentCPU)
|
|||||||
{
|
{
|
||||||
cpu_ent* cpu = thread_get_current_thread()->cpu;
|
cpu_ent* cpu = thread_get_current_thread()->cpu;
|
||||||
cpu->invoke_scheduler = true;
|
cpu->invoke_scheduler = true;
|
||||||
cpu->invoke_scheduler_if_idle = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case SMP_MSG_RESCHEDULE_IF_IDLE:
|
|
||||||
{
|
|
||||||
cpu_ent* cpu = thread_get_current_thread()->cpu;
|
|
||||||
if (!cpu->invoke_scheduler) {
|
|
||||||
cpu->invoke_scheduler = true;
|
|
||||||
cpu->invoke_scheduler_if_idle = true;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user