lkml.org 
[lkml]   [2018]   [Sep]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC 32/60] cosched: Specialize parent_cfs_rq() for hierarchical runqueues
Date
Make parent_cfs_rq() coscheduling-aware.

Signed-off-by: Jan H. Schönherr <jschoenh@amazon.de>
---
kernel/sched/fair.c | 13 +++++++++++++
1 file changed, 13 insertions(+)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 8504790944bf..8cba7b8fb6bd 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -284,12 +284,25 @@ static inline struct cfs_rq *group_cfs_rq(struct sched_entity *grp)
return grp->my_q;
}

+#ifdef CONFIG_COSCHEDULING
+static inline struct cfs_rq *parent_cfs_rq(struct cfs_rq *cfs_rq)
+{
+ /*
+ * Only return TG parent (if valid), don't switch levels.
+ * Callers stay or expect to stay within the same level.
+ */
+ if (!cfs_rq->sdrq.tg_parent || !cfs_rq->sdrq.is_root)
+ return NULL;
+ return cfs_rq->sdrq.tg_parent->cfs_rq;
+}
+#else /* !CONFIG_COSCHEDULING */
static inline struct cfs_rq *parent_cfs_rq(struct cfs_rq *cfs_rq)
{
if (!cfs_rq->tg->parent)
return NULL;
return cfs_rq->tg->parent->cfs_rq[cpu_of(rq_of(cfs_rq))];
}
+#endif /* !CONFIG_COSCHEDULING */

static inline void list_add_leaf_cfs_rq(struct cfs_rq *cfs_rq)
{
--
2.9.3.1.gcba166c.dirty
\
 
 \ /
  Last update: 2018-09-07 23:47    [W:0.484 / U:4.556 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site