[Devel,RHEL7,COMMIT] Revert "ve/sched: Do not loose boosting during set_next_entity() called for not busted task"

Submitted by Konstantin Khorenko on Dec. 13, 2016, 11:52 a.m.

Details

Message ID 201612131152.uBDBqqSr028950@finist_cl7.x64_64.work.ct
State New
Series "sched: Do not loose boosting during set_next_entity() called for not busted task"
Headers show

Commit Message

Konstantin Khorenko Dec. 13, 2016, 11:52 a.m.
The commit is pushed to "branch-rh7-3.10.0-327.36.1.vz7.20.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-327.36.1.vz7.20.14
------>
commit 1888a40e596a83417bb26c4790d9c98751394cb7
Author: Konstantin Khorenko <khorenko@virtuozzo.com>
Date:   Tue Dec 13 15:49:43 2016 +0400

    Revert "ve/sched: Do not loose boosting during set_next_entity() called for not busted task"
    
    This reverts commit 4bd37ae69b5864a02dd9643a8e02a465e60c3b97.
    
    ktkhai@: The patch is not correct, because we always dequeue boosted parents of
    current task, while it's running, and queue it back, when it's put.
    
    To be reworked.
    
    https://jira.sw.ru/browse/PSBM-57063
    
    Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 kernel/sched/fair.c | 21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)

Patch hide | download patch | download mbox

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 5f276ab..96fe1d5 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -3176,7 +3176,7 @@  check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr)
 }
 
 static void
-set_next_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, bool boosted)
+set_next_entity(struct cfs_rq *cfs_rq, struct sched_entity *se)
 {
 	/* 'current' is not kept within the tree. */
 	if (se->on_rq) {
@@ -3187,7 +3187,7 @@  set_next_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, bool boosted)
 		 */
 		update_stats_wait_end(cfs_rq, se);
 		__dequeue_entity(cfs_rq, se);
-		if (entity_boosted(se) && boosted)
+		if (entity_boosted(se))
 			__dequeue_boosted_entity(cfs_rq, se);
 	}
 
@@ -5050,15 +5050,7 @@  static struct task_struct *pick_next_task_fair(struct rq *rq)
 
 	do {
 		se = pick_next_entity(cfs_rq);
-		/*
-		 * If se can be dequeued from boosted node,
-		 * we will pick a boosted task at the end,
-		 * because we pick boosted tasks firstly.
-		 * So, "true" covers this case.
-		 * If se is not boosted, "true" does not
-		 * affect any way. Thus, pass it unconditionally.
-		 */
-		set_next_entity(cfs_rq, se, true);
+		set_next_entity(cfs_rq, se);
 		cfs_rq = group_cfs_rq(se);
 	} while (cfs_rq);
 
@@ -7867,16 +7859,11 @@  static void switched_to_fair(struct rq *rq, struct task_struct *p)
 static void set_curr_task_fair(struct rq *rq)
 {
 	struct sched_entity *se = &rq->curr->se;
-	bool boosted = false;
-
-#ifdef CONFIG_CFS_BANDWIDTH
-	boosted = se->boosted;
-#endif
 
 	for_each_sched_entity(se) {
 		struct cfs_rq *cfs_rq = cfs_rq_of(se);
 
-		set_next_entity(cfs_rq, se, boosted);
+		set_next_entity(cfs_rq, se);
 		/* ensure bandwidth has been allocated on our new cfs_rq */
 		account_cfs_rq_runtime(cfs_rq, 0);
 	}