diff options
Diffstat (limited to 'kernel/sched_fair.c')
-rw-r--r-- | kernel/sched_fair.c | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index 1d99535b0928..9357ecdb7f6b 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c | |||
@@ -1583,24 +1583,18 @@ wakeup_gran(struct sched_entity *curr, struct sched_entity *se) | |||
1583 | /* | 1583 | /* |
1584 | * Since its curr running now, convert the gran from real-time | 1584 | * Since its curr running now, convert the gran from real-time |
1585 | * to virtual-time in his units. | 1585 | * to virtual-time in his units. |
1586 | * | ||
1587 | * By using 'se' instead of 'curr' we penalize light tasks, so | ||
1588 | * they get preempted easier. That is, if 'se' < 'curr' then | ||
1589 | * the resulting gran will be larger, therefore penalizing the | ||
1590 | * lighter, if otoh 'se' > 'curr' then the resulting gran will | ||
1591 | * be smaller, again penalizing the lighter task. | ||
1592 | * | ||
1593 | * This is especially important for buddies when the leftmost | ||
1594 | * task is higher priority than the buddy. | ||
1586 | */ | 1595 | */ |
1587 | if (sched_feat(ASYM_GRAN)) { | 1596 | if (unlikely(se->load.weight != NICE_0_LOAD)) |
1588 | /* | 1597 | gran = calc_delta_fair(gran, se); |
1589 | * By using 'se' instead of 'curr' we penalize light tasks, so | ||
1590 | * they get preempted easier. That is, if 'se' < 'curr' then | ||
1591 | * the resulting gran will be larger, therefore penalizing the | ||
1592 | * lighter, if otoh 'se' > 'curr' then the resulting gran will | ||
1593 | * be smaller, again penalizing the lighter task. | ||
1594 | * | ||
1595 | * This is especially important for buddies when the leftmost | ||
1596 | * task is higher priority than the buddy. | ||
1597 | */ | ||
1598 | if (unlikely(se->load.weight != NICE_0_LOAD)) | ||
1599 | gran = calc_delta_fair(gran, se); | ||
1600 | } else { | ||
1601 | if (unlikely(curr->load.weight != NICE_0_LOAD)) | ||
1602 | gran = calc_delta_fair(gran, curr); | ||
1603 | } | ||
1604 | 1598 | ||
1605 | return gran; | 1599 | return gran; |
1606 | } | 1600 | } |