diff options
author | Peter Boonstoppel <pboonstoppel@nvidia.com> | 2012-08-09 15:34:47 -0700 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2014-02-15 19:20:18 +0000 |
commit | 4553dab7f3e57b70fee61739325b6ff7bb56ac9b (patch) | |
tree | 3f9255343b491e04889c9711ce262872bbed84c1 /kernel | |
parent | aee1f8b87e203b0525f340d2fde94f5a82f6c4bd (diff) |
sched: Unthrottle rt runqueues in __disable_runtime()
commit a4c96ae319b8047f62dedbe1eac79e321c185749 upstream.
migrate_tasks() uses _pick_next_task_rt() to get tasks from the
real-time runqueues to be migrated. When rt_rq is throttled
_pick_next_task_rt() won't return anything, in which case
migrate_tasks() can't move all threads over and gets stuck in an
infinite loop.
Instead unthrottle rt runqueues before migrating tasks.
Additionally: move unthrottle_offline_cfs_rqs() to rq_offline_fair()
Signed-off-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Turner <pjt@google.com>
Link: http://lkml.kernel.org/r/5FBF8E85CA34454794F0F7ECBA79798F379D3648B7@HQMAIL04.nvidia.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
[ lizf: backported to 3.4: adjust context ]
Signed-off-by: Li Zefan <lizefan@huawei.com>
[bwh: Backported to 3.2:
- Adjust filenames
- unthrottle_offline_cfs_rqs() is already static, but defined in sched.c
after including sched_fair.c, so add forward declaration
- unthrottle_offline_cfs_rqs() also needs to be defined for all CONFIG_SMP
configurations now]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched.c | 13 | ||||
-rw-r--r-- | kernel/sched_fair.c | 3 | ||||
-rw-r--r-- | kernel/sched_rt.c | 1 |
3 files changed, 12 insertions, 5 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index d93369a977d..ea85b0d2bbf 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -2189,6 +2189,10 @@ static int irqtime_account_si_update(void) #endif +#ifdef CONFIG_SMP +static void unthrottle_offline_cfs_rqs(struct rq *rq); +#endif + #include "sched_idletask.c" #include "sched_fair.c" #include "sched_rt.c" @@ -6566,8 +6570,6 @@ static void unthrottle_offline_cfs_rqs(struct rq *rq) unthrottle_cfs_rq(cfs_rq); } } -#else -static void unthrottle_offline_cfs_rqs(struct rq *rq) {} #endif /* @@ -6595,9 +6597,6 @@ static void migrate_tasks(unsigned int dead_cpu) */ rq->stop = NULL; - /* Ensure any throttled groups are reachable by pick_next_task */ - unthrottle_offline_cfs_rqs(rq); - for ( ; ; ) { /* * There's this thread running, bail when that's the only @@ -6624,6 +6623,10 @@ static void migrate_tasks(unsigned int dead_cpu) #endif /* CONFIG_HOTPLUG_CPU */ +#if !defined(CONFIG_HOTPLUG_CPU) || !defined(CONFIG_CFS_BANDWIDTH) +static void unthrottle_offline_cfs_rqs(struct rq *rq) {} +#endif + #if defined(CONFIG_SCHED_DEBUG) && defined(CONFIG_SYSCTL) static struct ctl_table sd_ctl_dir[] = { diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index 5b9e456ea98..37f3f3925d3 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c @@ -4848,6 +4848,9 @@ static void rq_online_fair(struct rq *rq) static void rq_offline_fair(struct rq *rq) { update_sysctl(); + + /* Ensure any throttled groups are reachable by pick_next_task */ + unthrottle_offline_cfs_rqs(rq); } #else /* CONFIG_SMP */ diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c index d0fff813937..2992f93b68c 100644 --- a/kernel/sched_rt.c +++ b/kernel/sched_rt.c @@ -509,6 +509,7 @@ balanced: * runtime - in which case borrowing doesn't make sense. */ rt_rq->rt_runtime = RUNTIME_INF; + rt_rq->rt_throttled = 0; raw_spin_unlock(&rt_rq->rt_runtime_lock); raw_spin_unlock(&rt_b->rt_runtime_lock); } |