From: Vincent Guittot <vincent.guittot@linaro.org>
To: peterz@infradead.org, mingo@kernel.org, linux-kernel@vger.kernel.org
Cc: rjw@rjwysocki.net, dietmar.eggemann@arm.com,
Morten.Rasmussen@arm.com, patrick.bellasi@arm.com,
pjt@google.com, bsegall@google.com, thara.gopinath@linaro.org,
pkondeti@codeaurora.org, quentin.perret@arm.com,
srinivas.pandruvada@linux.intel.com,
Vincent Guittot <vincent.guittot@linaro.org>
Subject: [PATCH v7 1/2] sched/fair: move rq_of helper function
Date: Tue, 20 Nov 2018 11:55:07 +0100 [thread overview]
Message-ID: <1542711308-25256-2-git-send-email-vincent.guittot@linaro.org> (raw)
In-Reply-To: <1542711308-25256-1-git-send-email-vincent.guittot@linaro.org>
Move rq_of() helper function so it can be used in pelt.c
Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
---
kernel/sched/fair.c | 13 -------------
kernel/sched/sched.h | 16 ++++++++++++++++
2 files changed, 16 insertions(+), 13 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index e30dea5..9cd1f32 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -248,13 +248,6 @@ const struct sched_class fair_sched_class;
*/
#ifdef CONFIG_FAIR_GROUP_SCHED
-
-/* cpu runqueue to which this cfs_rq is attached */
-static inline struct rq *rq_of(struct cfs_rq *cfs_rq)
-{
- return cfs_rq->rq;
-}
-
static inline struct task_struct *task_of(struct sched_entity *se)
{
SCHED_WARN_ON(!entity_is_task(se));
@@ -411,12 +404,6 @@ static inline struct task_struct *task_of(struct sched_entity *se)
return container_of(se, struct task_struct, se);
}
-static inline struct rq *rq_of(struct cfs_rq *cfs_rq)
-{
- return container_of(cfs_rq, struct rq, cfs);
-}
-
-
#define for_each_sched_entity(se) \
for (; se; se = NULL)
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index e0e052a..67e2d56 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -930,6 +930,22 @@ struct rq {
#endif
};
+#ifdef CONFIG_FAIR_GROUP_SCHED
+
+/* cpu runqueue to which this cfs_rq is attached */
+static inline struct rq *rq_of(struct cfs_rq *cfs_rq)
+{
+ return cfs_rq->rq;
+}
+
+#else /* !CONFIG_FAIR_GROUP_SCHED */
+
+static inline struct rq *rq_of(struct cfs_rq *cfs_rq)
+{
+ return container_of(cfs_rq, struct rq, cfs);
+}
+#endif
+
static inline int cpu_of(struct rq *rq)
{
#ifdef CONFIG_SMP
--
2.7.4
next prev parent reply other threads:[~2018-11-20 10:55 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-20 10:55 [PATCH v7 0/2] sched/fair: update scale invariance of PELT Vincent Guittot
2018-11-20 10:55 ` Vincent Guittot [this message]
2018-11-20 10:55 ` [PATCH v7 2/2] " Vincent Guittot
2018-11-28 9:54 ` Vincent Guittot
2018-11-28 10:02 ` Peter Zijlstra
2018-11-28 11:53 ` Patrick Bellasi
2018-11-28 13:33 ` Vincent Guittot
2018-11-28 13:35 ` Vincent Guittot
2018-11-28 14:40 ` Patrick Bellasi
2018-11-28 14:55 ` Vincent Guittot
2018-11-28 15:21 ` Patrick Bellasi
2018-11-28 15:42 ` Vincent Guittot
2018-11-28 16:35 ` Patrick Bellasi
2018-11-29 10:43 ` Vincent Guittot
2018-11-29 15:00 ` Patrick Bellasi
2018-11-29 16:19 ` Vincent Guittot
2019-01-10 15:30 ` Patrick Bellasi
2019-01-11 14:29 ` Vincent Guittot
2018-11-29 12:53 ` Peter Zijlstra
2018-11-29 15:13 ` Patrick Bellasi
2019-01-24 9:07 ` Peter Zijlstra
2019-01-24 14:04 ` Patrick Bellasi
2019-01-29 19:42 ` Peter Zijlstra
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=1542711308-25256-2-git-send-email-vincent.guittot@linaro.org \
--to=vincent.guittot@linaro.org \
--cc=Morten.Rasmussen@arm.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=patrick.bellasi@arm.com \
--cc=peterz@infradead.org \
--cc=pjt@google.com \
--cc=pkondeti@codeaurora.org \
--cc=quentin.perret@arm.com \
--cc=rjw@rjwysocki.net \
--cc=srinivas.pandruvada@linux.intel.com \
--cc=thara.gopinath@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®