mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
sched/fair: Fix the dealing with decay_count in __synchronize_entity_decay()
In __synchronize_entity_decay(), if "decays" happens to be zero, se->avg.decay_count will not be zeroed, holding the positive value assigned when dequeued last time. This is problematic in the following case: If this runnable task is CFS-balanced to other CPUs soon afterwards, migrate_task_rq_fair() will treat it as a blocked task due to its non-zero decay_count, thereby adding its load to cfs_rq->removed_load wrongly. Thus, we must zero se->avg.decay_count in this case as well. Signed-off-by: Xunlei Pang <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Ben Segall <[email protected]> Cc: Linus Torvalds <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
parent
7f1a169b88
commit
638476007d
1 changed files with 1 additions and 1 deletions
|
|
@ -2574,11 +2574,11 @@ static inline u64 __synchronize_entity_decay(struct sched_entity *se)
|
|||
u64 decays = atomic64_read(&cfs_rq->decay_counter);
|
||||
|
||||
decays -= se->avg.decay_count;
|
||||
se->avg.decay_count = 0;
|
||||
if (!decays)
|
||||
return 0;
|
||||
|
||||
se->avg.load_avg_contrib = decay_load(se->avg.load_avg_contrib, decays);
|
||||
se->avg.decay_count = 0;
|
||||
|
||||
return decays;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue