From: Thomas Gleixner <tglx@linutronix.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Sebastian Siewior <bigeasy@linutronix.de>,
Qais Yousef <qais.yousef@arm.com>, Scott Wood <swood@redhat.com>,
"Peter Zijlstra (Intel)" <peterz@infradead.org>,
Valentin Schneider <valentin.schneider@arm.com>,
Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Juri Lelli <juri.lelli@redhat.com>,
Vincent Guittot <vincent.guittot@linaro.org>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
Steven Rostedt <rostedt@goodmis.org>,
Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
Daniel Bristot de Oliveira <bristot@redhat.com>,
Vincent Donnefort <vincent.donnefort@arm.com>
Subject: [patch 08/10] sched: Add update_migratory() callback to scheduler classes
Date: Thu, 17 Sep 2020 11:42:10 +0200 [thread overview]
Message-ID: <20200917101624.708629719@linutronix.de> (raw)
In-Reply-To: 20200917094202.301694311@linutronix.de
Provide a mechanism to update the number or migratory tasks in the RT and
deadline scheduler classes.
This will be used by the upcoming migrate_disable/enable() functionality on
RT kernels.
Originally-by: Daniel Bristot de Oliveira <bristot@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
kernel/sched/deadline.c | 10 ++++++++++
kernel/sched/rt.c | 10 ++++++++++
kernel/sched/sched.h | 4 ++++
3 files changed, 24 insertions(+)
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -479,6 +479,13 @@ static void dec_dl_migration(struct sche
update_dl_migration(dl_rq);
}
+#ifdef CONFIG_PREEMPT_RT
+static void update_migratory_dl(struct task_struct *p, long delta)
+{
+ task_rq(p)->dl.dl_nr_migratory += delta;
+}
+#endif
+
/*
* The list of pushable -deadline task is not a plist, like in
* sched_rt.c, it is an rb-tree with tasks ordered by deadline.
@@ -2499,6 +2506,9 @@ const struct sched_class dl_sched_class
.rq_online = rq_online_dl,
.rq_offline = rq_offline_dl,
.task_woken = task_woken_dl,
+#ifdef CONFIG_PREEMPT_RT
+ .update_migratory = update_migratory_dl,
+#endif
#endif
.task_tick = task_tick_dl,
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -2272,6 +2272,13 @@ static void switched_from_rt(struct rq *
rt_queue_pull_task(rq);
}
+#ifdef CONFIG_PREEMPT_RT
+static void update_migratory_rt(struct task_struct *p, long delta)
+{
+ task_rq(p)->rt.rt_nr_migratory += delta;
+}
+#endif
+
void __init init_sched_rt_class(void)
{
unsigned int i;
@@ -2449,6 +2456,9 @@ const struct sched_class rt_sched_class
.rq_offline = rq_offline_rt,
.task_woken = task_woken_rt,
.switched_from = switched_from_rt,
+#ifdef CONFIG_PREEMPT_RT
+ .update_migratory = update_migratory_rt,
+#endif
#endif
.task_tick = task_tick_rt,
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -1808,6 +1808,10 @@ struct sched_class {
void (*set_cpus_allowed)(struct task_struct *p,
const struct cpumask *newmask);
+#ifdef CONFIG_PREEMPT_RT
+ void (*update_migratory)(struct task_struct *p, long delta);
+#endif
+
void (*rq_online)(struct rq *rq);
void (*rq_offline)(struct rq *rq);
#endif
next prev parent reply other threads:[~2020-09-17 10:52 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-17 9:42 [patch 00/10] sched: Migrate disable support for RT Thomas Gleixner
2020-09-17 9:42 ` [patch 01/10] sched: Fix balance_callback() Thomas Gleixner
2020-09-19 22:48 ` kernel test robot
2020-09-17 9:42 ` [patch 02/10] sched/hotplug: Ensure only per-cpu kthreads run during hotplug Thomas Gleixner
2020-09-17 9:42 ` [patch 03/10] sched/core: Wait for tasks being pushed away on hotplug Thomas Gleixner
2020-09-17 9:42 ` [patch 04/10] sched/hotplug: Consolidate task migration on CPU unplug Thomas Gleixner
2020-09-21 8:33 ` [sched/hotplug] fc8cae04ec: kernel_BUG_at_kernel/sched/core.c kernel test robot
2020-09-17 9:42 ` [patch 05/10] sched/core: Split __set_cpus_allowed_ptr() Thomas Gleixner
2020-09-17 9:42 ` [patch 06/10] sched: Add task components for migration control Thomas Gleixner
2020-09-17 9:42 ` [patch 07/10] sched/core: Add mechanism to wait for affinity setting to complete Thomas Gleixner
2020-09-17 9:42 ` Thomas Gleixner [this message]
2020-09-17 9:42 ` [patch 09/10] sched/core: Add migrate_disable/enable() Thomas Gleixner
2020-09-17 14:24 ` peterz
2020-09-17 14:38 ` Sebastian Siewior
2020-09-17 14:49 ` peterz
2020-09-17 15:13 ` Sebastian Siewior
2020-09-17 15:54 ` peterz
2020-09-17 16:30 ` Sebastian Siewior
2020-09-18 8:22 ` peterz
2020-09-18 8:48 ` Sebastian Siewior
2020-09-18 7:00 ` Thomas Gleixner
2020-09-18 8:28 ` peterz
2020-09-17 9:42 ` [patch 10/10] sched/core: Make migrate disable and CPU hotplug cooperative Thomas Gleixner
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=20200917101624.708629719@linutronix.de \
--to=tglx@linutronix.de \
--cc=bigeasy@linutronix.de \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=qais.yousef@arm.com \
--cc=rostedt@goodmis.org \
--cc=swood@redhat.com \
--cc=valentin.schneider@arm.com \
--cc=vincent.donnefort@arm.com \
--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.