Skip to contentSkip to conversation

sched/fair: make update_curr_fair() update whole hierarhy

PATCH In review Kirill Tkhai 1 participant 1 message May 26, 2015 Scheduler

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 sched/fair: make update_curr_fair() update whole hierarhy

This patch makes update_curr_fair() similar to update_curr_rt(), which updates runtime on whole hierarhy. We need that in next patch.

---
 kernel/sched/fair.c |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
kernel/sched/fair.c +12 -1
index d597aea..ece94af 100644
@@ -729,7 +729,18 @@ static void update_curr(struct cfs_rq *cfs_rq)
 
 static void update_curr_fair(struct rq *rq)
 {
-	update_curr(cfs_rq_of(&rq->curr->se));
+	struct task_struct *curr = rq->curr;
+	struct sched_entity *se;
+	struct cfs_rq *cfs_rq;
+
+	if (curr->sched_class != &fair_sched_class)
+		return;
+	se = &curr->se;
+	for_each_sched_entity(se) {
+		cfs_rq = cfs_rq_of(se);
+		update_curr(cfs_rq);
+	}
+
 }
 
 static inline void