Merge branch 'linux-linaro-lsk-v4.4-android' of git://git.linaro.org/kernel/linux...
[firefly-linux-kernel-4.4.55.git] / kernel / sched / fair.c
index d5965cfbd3d729595644ecc84363c7af925f865d..f03f54704c6d6036ec7f73b065c5675a32dbbb2b 100644 (file)
@@ -2757,6 +2757,10 @@ static inline int update_cfs_rq_load_avg(u64 now, struct cfs_rq *cfs_rq)
        cfs_rq->load_last_update_time_copy = sa->last_update_time;
 #endif
 
+       /* Trace CPU load, unless cfs_rq belongs to a non-root task_group */
+       if (cfs_rq == &rq_of(cfs_rq)->cfs)
+               trace_sched_load_avg_cpu(cpu_of(rq_of(cfs_rq)), cfs_rq);
+
        return decayed || removed;
 }
 
@@ -2780,7 +2784,6 @@ static inline void update_load_avg(struct sched_entity *se, int update_tg)
 
        if (entity_is_task(se))
                trace_sched_load_avg_task(task_of(se), &se->avg);
-       trace_sched_load_avg_cpu(cpu, cfs_rq);
 }
 
 static void attach_entity_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *se)