* Added cpu_ent::running_thread which is maintained by the schedulers.
* simple_smp scheduler: Rewrote the interesting part of enqueue_in_run_queue(). It always selects a target CPU for the inserted thread, now. If no CPU is idle, the CPU running the thread with the lowest priority is chosen. If the thread running on the target CPU has a lower priority than the inserted one, it will be asked to reschedule. If that's the current CPU, we'll return the correct value (wasn't done before at all). These changes help reducing latencies. On my machine in an idle system playing music DebugAnalyzer shows maximum latencies of about 1 us. I still find that a bit much, but it's several orders of magnitude better than before. The -j8 Haiku image build time dropped about 10%. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34635 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -2141,6 +2141,8 @@ thread_init(kernel_args *args)
|
||||
return B_NO_MEMORY;
|
||||
}
|
||||
|
||||
gCPU[i].running_thread = thread;
|
||||
|
||||
thread->team = team_get_kernel_team();
|
||||
thread->priority = thread->next_priority = B_IDLE_PRIORITY;
|
||||
thread->state = B_THREAD_RUNNING;
|
||||
|
||||
Reference in New Issue
Block a user