scheduler: Fix setting priorities following the penalty cancellation changes.

Before hrev46809, the "thread->priority = priority" line was below this
check, and so all was well. But that commit moved the line to its present
location, which means ever since then, the following code which updates
CPU entries, scheduler listeners, etc. has never been run.

On my VMware instance (which is probably pretty affected by the host system
and thus not the greatest performance test), "time jam -j2 HaikuDepot" decreased
from 46.0s real to 43.3s real, 52.3s user to 48.1s user, 12.1s sys to 12.2s sys.
So this seems to make some sort of impact.

Spotted by Fishpond in #10454 and confirmed by korli, but somehow neither of
them followed up on that in the 4.5 years since...
This commit is contained in:
Augustin Cavalier
2018-07-11 21:53:44 -04:00
parent a052f4807f
commit 3142fb6996
+2 -2
View File
@@ -184,8 +184,8 @@ scheduler_set_thread_priority(Thread *thread, int32 priority)
thread->priority = priority;
threadData->CancelPenalty();
if (priority == thread->priority)
return thread->priority;
if (priority == oldPriority)
return oldPriority;
if (thread->state != B_THREAD_READY) {
if (thread->state == B_THREAD_RUNNING) {