Skip to contentSkip to conversation

sched/fair: Cleanup: remove dublicate variable declaration

PATCH New Kirill Tkhai 2 participants 2 messages Jul 21, 2013 – Jul 23, 2013 Scheduler

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sched/fair: Cleanup: remove dublicate variable declaration

cfs_rq is declarated twice. place_entity() doesn't change cfs_rq, so it's erratum. Fix that.
(and use above declarated se instead of &p->se)

CC Ingo Molnar <[email protected]>
CC Peter Zijlstra <[email protected]>
CC Steven Rostedt <[email protected]>
---
 kernel/sched/fair.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
kernel/sched/fair.c +3 -5
index 9565645..f918635 100644
@@ -5889,11 +5889,9 @@ static void switched_from_fair(struct rq *rq, struct task_struct *p)
 	* and ensure we don't carry in an old decay_count if we
 	* switch back.
 	*/
-	if (p->se.avg.decay_count) {
-		struct cfs_rq *cfs_rq = cfs_rq_of(&p->se);
-		__synchronize_entity_decay(&p->se);
-		subtract_blocked_load_contrib(cfs_rq,
-				p->se.avg.load_avg_contrib);
+	if (se->avg.decay_count) {
+		__synchronize_entity_decay(se);
+		subtract_blocked_load_contrib(cfs_rq, se->avg.load_avg_contrib);
 	}
 #endif
 }
#1 lore raw

[tip:sched/core] sched/fair: Cleanup: remove duplicate variable declaration

sched/fair: Cleanup: remove duplicate variable declaration
Commit-ID:  87e3c8ae1c8676b9dd56b56456dafa14a4bacf97
Gitweb:     http://git.kernel.org/tip/87e3c8ae1c8676b9dd56b56456dafa14a4bacf97
Author:     Kirill Tkhai <[email protected]>
AuthorDate: Sun, 21 Jul 2013 04:32:07 +0400
Committer:  Ingo Molnar <[email protected]>
CommitDate: Mon, 22 Jul 2013 10:27:40 +0200

sched/fair: Cleanup: remove duplicate variable declaration

cfs_rq is declared twice, fix it.

Also use 'se' instead of '&p->se'.

---
 kernel/sched/fair.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
kernel/sched/fair.c +3 -5
index bb456f4..ab59978 100644
@@ -5889,11 +5889,9 @@ static void switched_from_fair(struct rq *rq, struct task_struct *p)
 	* and ensure we don't carry in an old decay_count if we
 	* switch back.
 	*/
-	if (p->se.avg.decay_count) {
-		struct cfs_rq *cfs_rq = cfs_rq_of(&p->se);
-		__synchronize_entity_decay(&p->se);
-		subtract_blocked_load_contrib(cfs_rq,
-				p->se.avg.load_avg_contrib);
+	if (se->avg.decay_count) {
+		__synchronize_entity_decay(se);
+		subtract_blocked_load_contrib(cfs_rq, se->avg.load_avg_contrib);
 	}
 #endif
 }