Small cleanup: As the cpu_ent struct now tracks the running thread directly, the affine scheduler can use that instead of keeping track internally.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34638 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Rene Gollent 2009-12-12 00:01:33 +00:00
parent e36d79e9dc
commit 5c7993bfab
2 changed files with 3 additions and 7 deletions

View File

@ -55,7 +55,7 @@ KernelMergeObject kernel_core.o :
# scheduler # scheduler
scheduler.cpp scheduler.cpp
# scheduler_affine.cpp scheduler_affine.cpp
scheduler_simple.cpp scheduler_simple.cpp
scheduler_simple_smp.cpp scheduler_simple_smp.cpp
scheduler_tracing.cpp scheduler_tracing.cpp

View File

@ -42,7 +42,6 @@
// TODO: consolidate this such that HT/SMT entities on the same physical core // TODO: consolidate this such that HT/SMT entities on the same physical core
// share a queue, once we have the necessary API for retrieving the topology // share a queue, once we have the necessary API for retrieving the topology
// information // information
static struct thread* sRunningThreads[B_MAX_CPU_COUNT];
static struct thread* sRunQueue[B_MAX_CPU_COUNT]; static struct thread* sRunQueue[B_MAX_CPU_COUNT];
static int32 sRunQueueSize[B_MAX_CPU_COUNT]; static int32 sRunQueueSize[B_MAX_CPU_COUNT];
static struct thread* sIdleThreads; static struct thread* sIdleThreads;
@ -192,8 +191,7 @@ affine_enqueue_in_run_queue(struct thread *thread)
NotifySchedulerListeners(&SchedulerListener::ThreadEnqueuedInRunQueue, NotifySchedulerListeners(&SchedulerListener::ThreadEnqueuedInRunQueue,
thread); thread);
if (sRunningThreads[targetCPU] != NULL if (thread->priority > gCPU[targetCPU].running_thread->priority) {
&& thread->priority > sRunningThreads[targetCPU]->priority) {
if (targetCPU == smp_get_current_cpu()) { if (targetCPU == smp_get_current_cpu()) {
return true; return true;
} else { } else {
@ -503,10 +501,8 @@ affine_reschedule(void)
add_timer(quantumTimer, &reschedule_event, quantum, add_timer(quantumTimer, &reschedule_event, quantum,
B_ONE_SHOT_RELATIVE_TIMER | B_TIMER_ACQUIRE_THREAD_LOCK); B_ONE_SHOT_RELATIVE_TIMER | B_TIMER_ACQUIRE_THREAD_LOCK);
if (nextThread != oldThread) { if (nextThread != oldThread)
sRunningThreads[currentCPU] = nextThread;
context_switch(oldThread, nextThread); context_switch(oldThread, nextThread);
}
} }
} }