Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F168732022
D1970.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
896 B
Referenced Files
None
Subscribers
None
D1970.diff
View Options
Index: sys/kern/sched_ule.c
===================================================================
--- sys/kern/sched_ule.c
+++ sys/kern/sched_ule.c
@@ -908,15 +909,21 @@
{
int moved;
int cpu;
-
+
+ /*
+ * Don't bother to lock if balancing doesn't make sense.
+ */
+
+ if (high->tdq_load <= low->tdq_load)
+ return(0);
+
tdq_lock_pair(high, low);
moved = 0;
/*
- * Determine what the imbalance is and then adjust that to how many
- * threads we actually have to give up (transferable).
+ * Move one thread from high to low if high has atleast 1
+ * transferrable thread.
*/
- if (high->tdq_transferable != 0 && high->tdq_load > low->tdq_load &&
- (moved = tdq_move(high, low)) > 0) {
+ if (high->tdq_transferable == 0 && (moved = tdq_move(high, low)) > 0) {
/*
* In case the target isn't the current cpu IPI it to force a
* reschedule with the new workload.
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Aug 30, 9:01 PM (5 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37625944
Default Alt Text
D1970.diff (896 B)
Attached To
Mode
D1970: Fix comment in sched_balance_pair and check load before locking
Attached
Detach File
Event Timeline
Log In to Comment