sched: reset blocked load decay_count during synchronization
authorChris Redpath <chris.redpath@arm.com>
Thu, 5 Dec 2013 15:49:32 +0000 (15:49 +0000)
committerJon Medhurst <tixy@linaro.org>
Wed, 22 Jan 2014 09:50:42 +0000 (09:50 +0000)
commitf720a920e88f1ec79db8c9f0031f61c610e40b02
treeb480f24aad671b6efc333d2c7c27c253e26ebc97
parent6bfbe7d9f891dc145ed395cf2b8c23b2dd9c74e8
sched: reset blocked load decay_count during synchronization

If an entity happens to sleep for less than one tick duration
the tracked load associated with that entity can be decayed by an
unexpectedly large amount if it is later migrated to a different
CPU. This can interfere with correct scheduling when entity load
is used for decision making.

The reason for this is that when an entity is dequeued and enqueued
quickly, such that se.avg.decay_count and cfs_rq.decay_counter
do not differ when that entity is enqueued again,
__synchronize_entity_decay skips the calculation step and also skips
clearing the decay_count. At a later time that entity may be
migrated and its load will be decayed incorrectly.

All users of this function expect decay_count to be zero'ed after
use.

Signed-off-by: Chris Redpath <chris.redpath@arm.com>
Signed-off-by: Jon Medhurst <tixy@linaro.org>
kernel/sched/fair.c