All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rik van Riel <riel@surriel.com>
To: linux-kernel@vger.kernel.org
Cc: kernel-team@fb.com, pjt@google.com, dietmar.eggemann@arm.com,
	peterz@infradead.org, mingo@redhat.com, morten.rasmussen@arm.com,
	tglx@linutronix.de, mgorman@techsingularity.net,
	vincent.guittot@linaro.org, Rik van Riel <riel@surriel.com>
Subject: [PATCH 15/15] sched,fair: remove se->depth
Date: Fri,  6 Sep 2019 15:12:37 -0400	[thread overview]
Message-ID: <20190906191237.27006-16-riel@surriel.com> (raw)
In-Reply-To: <20190906191237.27006-1-riel@surriel.com>

Remove se->depth and the code that touches it, since we no longer need
any of that.

Signed-off-by: Rik van Riel <riel@surriel.com>
Suggested-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
---
 include/linux/sched.h |  1 -
 kernel/sched/fair.c   | 50 ++-----------------------------------------
 2 files changed, 2 insertions(+), 49 deletions(-)

diff --git a/include/linux/sched.h b/include/linux/sched.h
index bdca15b3afe7..94aec4065fd1 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -451,7 +451,6 @@ struct sched_entity {
 	struct sched_statistics		statistics;
 
 #ifdef CONFIG_FAIR_GROUP_SCHED
-	int				depth;
 	unsigned long			enqueued_h_load;
 	unsigned long			enqueued_h_weight;
 	u64				propagated_exec_runtime;
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 3c25ab666799..0fb3de853d45 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -438,38 +438,6 @@ static inline bool task_se_in_cgroup(struct sched_entity *se)
 	return parent_entity(se);
 }
 
-static void
-find_matching_se(struct sched_entity **se, struct sched_entity **pse)
-{
-	int se_depth, pse_depth;
-
-	/*
-	 * preemption test can be made between sibling entities who are in the
-	 * same cfs_rq i.e who have a common parent. Walk up the hierarchy of
-	 * both tasks until we find their ancestors who are siblings of common
-	 * parent.
-	 */
-
-	/* First walk up until both entities are at same depth */
-	se_depth = (*se)->depth;
-	pse_depth = (*pse)->depth;
-
-	while (se_depth > pse_depth) {
-		se_depth--;
-		*se = parent_entity(*se);
-	}
-
-	while (pse_depth > se_depth) {
-		pse_depth--;
-		*pse = parent_entity(*pse);
-	}
-
-	while (!is_same_group(*se, *pse)) {
-		*se = parent_entity(*se);
-		*pse = parent_entity(*pse);
-	}
-}
-
 /* Add the cgroup cfs_rqs to the list, for update_blocked_averages */
 static void enqueue_entity_cfs_rqs(struct sched_entity *se)
 {
@@ -10221,14 +10189,6 @@ static void attach_entity_cfs_rq(struct sched_entity *se)
 	int flags = sched_feat(ATTACH_AGE_LOAD) ? 0 : SKIP_AGE_LOAD;
 	struct cfs_rq *cfs_rq = group_cfs_rq_of_parent(se);
 
-#ifdef CONFIG_FAIR_GROUP_SCHED
-	/*
-	 * Since the real-depth could have been changed (only FAIR
-	 * class maintain depth value), reset depth properly.
-	 */
-	se->depth = se->parent ? se->parent->depth + 1 : 0;
-#endif
-
 	/* Synchronize entity with its cfs_rq */
 	update_load_avg(cfs_rq, se, flags);
 	attach_entity_load_avg(cfs_rq, se, 0);
@@ -10316,10 +10276,7 @@ void init_cfs_rq(struct cfs_rq *cfs_rq)
 #ifdef CONFIG_FAIR_GROUP_SCHED
 static void task_set_group_fair(struct task_struct *p)
 {
-	struct sched_entity *se = &p->se;
-
 	set_task_rq(p, task_cpu(p));
-	se->depth = se->parent ? se->parent->depth + 1 : 0;
 }
 
 static void task_move_group_fair(struct task_struct *p)
@@ -10465,13 +10422,10 @@ void init_tg_cfs_entry(struct task_group *tg, struct cfs_rq *cfs_rq,
 	if (!se)
 		return;
 
-	if (!parent) {
+	if (!parent)
 		se->cfs_rq = &rq->cfs;
-		se->depth = 0;
-	} else {
+	else
 		se->cfs_rq = parent->my_q;
-		se->depth = parent->depth + 1;
-	}
 
 	se->my_q = cfs_rq;
 	/* guarantee group entities always have weight */
-- 
2.20.1


      parent reply	other threads:[~2019-09-06 19:14 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-06 19:12 [PATCH RFC v5 0/15] sched,fair: flatten CPU controller runqueues Rik van Riel
2019-09-06 19:12 ` [PATCH 01/15] sched: introduce task_se_h_load helper Rik van Riel
2019-09-06 19:12 ` [PATCH 02/15] sched: change /proc/sched_debug fields Rik van Riel
2019-09-06 19:12 ` [PATCH 03/15] sched,fair: redefine runnable_load_avg as the sum of task_h_load Rik van Riel
2019-09-06 19:12 ` [PATCH 04/15] sched,fair: move runnable_load_avg to cfs_rq Rik van Riel
2019-09-06 19:12 ` [PATCH 05/15] sched,fair: remove cfs_rqs from leaf_cfs_rq_list bottom up Rik van Riel
2019-09-06 19:12 ` [PATCH 06/15] sched,cfs: use explicit cfs_rq of parent se helper Rik van Riel
2019-09-06 19:12 ` [PATCH 07/15] sched,cfs: fix zero length timeslice calculation Rik van Riel
2019-09-06 19:12 ` [PATCH 08/15] sched,fair: refactor enqueue/dequeue_entity Rik van Riel
2019-09-06 19:12 ` [PATCH 09/15] sched,fair: add helper functions for flattened runqueue Rik van Riel
2019-09-06 19:12 ` [PATCH 10/15] sched,fair: flatten hierarchical runqueues Rik van Riel
2019-09-06 19:12 ` [PATCH 11/15] sched,fair: flatten update_curr functionality Rik van Riel
2019-09-06 19:12 ` [PATCH 12/15] sched,fair: propagate sum_exec_runtime up the hierarchy Rik van Riel
2019-09-06 19:12 ` [PATCH 13/15] sched,fair: ramp up task_se_h_weight quickly Rik van Riel
2019-09-06 19:12 ` [PATCH 14/15] sched,fair: scale vdiff in wakeup_preempt_entity Rik van Riel
2019-09-06 19:12 ` Rik van Riel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190906191237.27006-16-riel@surriel.com \
    --to=riel@surriel.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@techsingularity.net \
    --cc=mingo@redhat.com \
    --cc=morten.rasmussen@arm.com \
    --cc=peterz@infradead.org \
    --cc=pjt@google.com \
    --cc=tglx@linutronix.de \
    --cc=vincent.guittot@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.