Author: anevilyak Date: 2009-12-12 01:01:33 +0100 (Sat, 12 Dec 2009) New Revision: 34638 Changeset: http://dev.haiku-os.org/changeset/34638/haiku Modified: haiku/trunk/src/system/kernel/Jamfile haiku/trunk/src/system/kernel/scheduler/scheduler_affine.cpp Log: Small cleanup: As the cpu_ent struct now tracks the running thread directly, the affine scheduler can use that instead of keeping track internally. Modified: haiku/trunk/src/system/kernel/Jamfile =================================================================== --- haiku/trunk/src/system/kernel/Jamfile 2009-12-11 23:28:28 UTC (rev 34637) +++ haiku/trunk/src/system/kernel/Jamfile 2009-12-12 00:01:33 UTC (rev 34638) @@ -55,7 +55,7 @@ # scheduler scheduler.cpp -# scheduler_affine.cpp + scheduler_affine.cpp scheduler_simple.cpp scheduler_simple_smp.cpp scheduler_tracing.cpp Modified: haiku/trunk/src/system/kernel/scheduler/scheduler_affine.cpp =================================================================== --- haiku/trunk/src/system/kernel/scheduler/scheduler_affine.cpp 2009-12-11 23:28:28 UTC (rev 34637) +++ haiku/trunk/src/system/kernel/scheduler/scheduler_affine.cpp 2009-12-12 00:01:33 UTC (rev 34638) @@ -42,7 +42,6 @@ // 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 // information -static struct thread* sRunningThreads[B_MAX_CPU_COUNT]; static struct thread* sRunQueue[B_MAX_CPU_COUNT]; static int32 sRunQueueSize[B_MAX_CPU_COUNT]; static struct thread* sIdleThreads; @@ -192,8 +191,7 @@ NotifySchedulerListeners(&SchedulerListener::ThreadEnqueuedInRunQueue, thread); - if (sRunningThreads[targetCPU] != NULL - && thread->priority > sRunningThreads[targetCPU]->priority) { + if (thread->priority > gCPU[targetCPU].running_thread->priority) { if (targetCPU == smp_get_current_cpu()) { return true; } else { @@ -503,10 +501,8 @@ add_timer(quantumTimer, &reschedule_event, quantum, B_ONE_SHOT_RELATIVE_TIMER | B_TIMER_ACQUIRE_THREAD_LOCK); - if (nextThread != oldThread) { - sRunningThreads[currentCPU] = nextThread; + if (nextThread != oldThread) context_switch(oldThread, nextThread); - } } }