Commit e69b0f1b41c0e57bb1e29100b5810a5914efcb45
Committed by
Ingo Molnar
1 parent
63859d4fe4
Exists in
master
and in
7 other branches
sched: Add a few SYNC hint knobs to play with
Currently we use overlap to weaken the SYNC hint, but allow it to set the hint as well. echo NO_SYNC_WAKEUP > /debug/sched_features echo SYNC_MORE > /debug/sched_features preserves pipe-test behaviour without using the WF_SYNC hint. Worth playing with on more workloads... Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Showing 2 changed files with 21 additions and 3 deletions Side-by-side Diff
kernel/sched_fair.c
... | ... | @@ -1165,9 +1165,17 @@ |
1165 | 1165 | load = source_load(prev_cpu, idx); |
1166 | 1166 | this_load = target_load(this_cpu, idx); |
1167 | 1167 | |
1168 | - if (sync && (curr->se.avg_overlap > sysctl_sched_migration_cost || | |
1169 | - p->se.avg_overlap > sysctl_sched_migration_cost)) | |
1170 | - sync = 0; | |
1168 | + if (sync) { | |
1169 | + if (sched_feat(SYNC_LESS) && | |
1170 | + (curr->se.avg_overlap > sysctl_sched_migration_cost || | |
1171 | + p->se.avg_overlap > sysctl_sched_migration_cost)) | |
1172 | + sync = 0; | |
1173 | + } else { | |
1174 | + if (sched_feat(SYNC_MORE) && | |
1175 | + (curr->se.avg_overlap < sysctl_sched_migration_cost && | |
1176 | + p->se.avg_overlap < sysctl_sched_migration_cost)) | |
1177 | + sync = 1; | |
1178 | + } | |
1171 | 1179 | |
1172 | 1180 | /* |
1173 | 1181 | * If sync wakeup then subtract the (maximum possible) |
kernel/sched_features.h
... | ... | @@ -63,6 +63,16 @@ |
63 | 63 | SCHED_FEAT(AFFINE_WAKEUPS, 1) |
64 | 64 | |
65 | 65 | /* |
66 | + * Weaken SYNC hint based on overlap | |
67 | + */ | |
68 | +SCHED_FEAT(SYNC_LESS, 1) | |
69 | + | |
70 | +/* | |
71 | + * Add SYNC hint based on overlap | |
72 | + */ | |
73 | +SCHED_FEAT(SYNC_MORE, 0) | |
74 | + | |
75 | +/* | |
66 | 76 | * Prefer to schedule the task we woke last (assuming it failed |
67 | 77 | * wakeup-preemption), since its likely going to consume data we |
68 | 78 | * touched, increases cache locality. |