aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Zhang <zhangwm@marvell.com>2013-04-11 09:04:59 -0400
committerIngo Molnar <mingo@kernel.org>2013-05-28 03:40:22 -0400
commitc5405a495e88d93cf9b4f4cc91507c7f4afcb901 (patch)
treec0d33303fb9162c610c5a0f0bc108f746d1e1b69
parent41261b6a832ea0e788627f6a8707854423f9ff49 (diff)
sched: Remove redundant update_runtime notifier
migration_call() will do all the things that update_runtime() does. So let's remove it. Furthermore, there is potential risk that the current code will catch BUG_ON at line 689 of rt.c when do cpu hotplug while there are realtime threads running because of enabling runtime twice while the rt_runtime may already changed. Signed-off-by: Neil Zhang <zhangwm@marvell.com> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1365685499-26515-1-git-send-email-zhangwm@marvell.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--kernel/sched/core.c3
-rw-r--r--kernel/sched/rt.c40
-rw-r--r--kernel/sched/sched.h1
3 files changed, 0 insertions, 44 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index bfa7e77e0b50..79e48e6a9385 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6285,9 +6285,6 @@ void __init sched_init_smp(void)
6285 hotcpu_notifier(cpuset_cpu_active, CPU_PRI_CPUSET_ACTIVE); 6285 hotcpu_notifier(cpuset_cpu_active, CPU_PRI_CPUSET_ACTIVE);
6286 hotcpu_notifier(cpuset_cpu_inactive, CPU_PRI_CPUSET_INACTIVE); 6286 hotcpu_notifier(cpuset_cpu_inactive, CPU_PRI_CPUSET_INACTIVE);
6287 6287
6288 /* RT runtime code needs to handle some hotplug events */
6289 hotcpu_notifier(update_runtime, 0);
6290
6291 init_hrtick(); 6288 init_hrtick();
6292 6289
6293 /* Move init over to a non-isolated CPU */ 6290 /* Move init over to a non-isolated CPU */
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index 7aced2e3b085..8853ab17b750 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -699,15 +699,6 @@ balanced:
699 } 699 }
700} 700}
701 701
702static void disable_runtime(struct rq *rq)
703{
704 unsigned long flags;
705
706 raw_spin_lock_irqsave(&rq->lock, flags);
707 __disable_runtime(rq);
708 raw_spin_unlock_irqrestore(&rq->lock, flags);
709}
710
711static void __enable_runtime(struct rq *rq) 702static void __enable_runtime(struct rq *rq)
712{ 703{
713 rt_rq_iter_t iter; 704 rt_rq_iter_t iter;
@@ -732,37 +723,6 @@ static void __enable_runtime(struct rq *rq)
732 } 723 }
733} 724}
734 725
735static void enable_runtime(struct rq *rq)
736{
737 unsigned long flags;
738
739 raw_spin_lock_irqsave(&rq->lock, flags);
740 __enable_runtime(rq);
741 raw_spin_unlock_irqrestore(&rq->lock, flags);
742}
743
744int update_runtime(struct notifier_block *nfb, unsigned long action, void *hcpu)
745{
746 int cpu = (int)(long)hcpu;
747
748 switch (action) {
749 case CPU_DOWN_PREPARE:
750 case CPU_DOWN_PREPARE_FROZEN:
751 disable_runtime(cpu_rq(cpu));
752 return NOTIFY_OK;
753
754 case CPU_DOWN_FAILED:
755 case CPU_DOWN_FAILED_FROZEN:
756 case CPU_ONLINE:
757 case CPU_ONLINE_FROZEN:
758 enable_runtime(cpu_rq(cpu));
759 return NOTIFY_OK;
760
761 default:
762 return NOTIFY_DONE;
763 }
764}
765
766static int balance_runtime(struct rt_rq *rt_rq) 726static int balance_runtime(struct rt_rq *rt_rq)
767{ 727{
768 int more = 0; 728 int more = 0;
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index f1f6256c1224..c806c61a1261 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -1041,7 +1041,6 @@ static inline void idle_balance(int cpu, struct rq *rq)
1041extern void sysrq_sched_debug_show(void); 1041extern void sysrq_sched_debug_show(void);
1042extern void sched_init_granularity(void); 1042extern void sched_init_granularity(void);
1043extern void update_max_interval(void); 1043extern void update_max_interval(void);
1044extern int update_runtime(struct notifier_block *nfb, unsigned long action, void *hcpu);
1045extern void init_sched_rt_class(void); 1044extern void init_sched_rt_class(void);
1046extern void init_sched_fair_class(void); 1045extern void init_sched_fair_class(void);
1047 1046