sched: remove redundant update_runtime notifier
authorNeil Zhang <zhangwm@marvell.com>
Fri, 28 Dec 2012 10:00:26 +0000 (10:00 +0000)
committerRiham Haidar <rhaidar@nvidia.com>
Mon, 6 May 2013 19:06:04 +0000 (12:06 -0700)
migration_call() will do all the things that update_runtime() does.
So it seems update_runtime() is a redundant notifier, remove it.

Furthermore, there is potential risk that the current code will catch
BUG_ON at line 687 of rt.c when do cpu hotplug while there are realtime
threads running because of enable runtime twice.

Change-Id: I0fdad8d5a1cebb845d3f308b205dbd6517c3e4de
Cc: bitbucket@online.de
Signed-off-by: Neil Zhang <zhangwm@marvell.com>
Reviewed-on: http://git-master/r/215596
(cherry picked from commit 8f646de983f24361814d9a6ca679845fb2265807)
Reviewed-on: http://git-master/r/223067
Reviewed-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
Tested-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
Reviewed-by: Paul Walmsley <pwalmsley@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
kernel/sched/core.c
kernel/sched/rt.c
kernel/sched/sched.h

index 928dd1fd1043b162aed41846367217323078811f..8fbbe9cfa1c9110c942422ce159d7bbcc68ff795 100644 (file)
@@ -7008,9 +7008,6 @@ void __init sched_init_smp(void)
        hotcpu_notifier(cpuset_cpu_active, CPU_PRI_CPUSET_ACTIVE);
        hotcpu_notifier(cpuset_cpu_inactive, CPU_PRI_CPUSET_INACTIVE);
 
-       /* RT runtime code needs to handle some hotplug events */
-       hotcpu_notifier(update_runtime, 0);
-
        init_hrtick();
 
        /* Move init over to a non-isolated CPU */
index be427c5bc4d794dc2e20d86f3a3f83fb651cbef0..1b41dda1157047fb37d7aa2d3ac2adb2ec80c3fb 100644 (file)
@@ -691,15 +691,6 @@ balanced:
        }
 }
 
-static void disable_runtime(struct rq *rq)
-{
-       unsigned long flags;
-
-       raw_spin_lock_irqsave(&rq->lock, flags);
-       __disable_runtime(rq);
-       raw_spin_unlock_irqrestore(&rq->lock, flags);
-}
-
 static void __enable_runtime(struct rq *rq)
 {
        rt_rq_iter_t iter;
@@ -724,37 +715,6 @@ static void __enable_runtime(struct rq *rq)
        }
 }
 
-static void enable_runtime(struct rq *rq)
-{
-       unsigned long flags;
-
-       raw_spin_lock_irqsave(&rq->lock, flags);
-       __enable_runtime(rq);
-       raw_spin_unlock_irqrestore(&rq->lock, flags);
-}
-
-int update_runtime(struct notifier_block *nfb, unsigned long action, void *hcpu)
-{
-       int cpu = (int)(long)hcpu;
-
-       switch (action) {
-       case CPU_DOWN_PREPARE:
-       case CPU_DOWN_PREPARE_FROZEN:
-               disable_runtime(cpu_rq(cpu));
-               return NOTIFY_OK;
-
-       case CPU_DOWN_FAILED:
-       case CPU_DOWN_FAILED_FROZEN:
-       case CPU_ONLINE:
-       case CPU_ONLINE_FROZEN:
-               enable_runtime(cpu_rq(cpu));
-               return NOTIFY_OK;
-
-       default:
-               return NOTIFY_DONE;
-       }
-}
-
 static int balance_runtime(struct rt_rq *rt_rq)
 {
        int more = 0;
index 99589411f980d8e72b3c77eb8cf55d8c21068a3e..1f6bc62e9e43e991aa49942a33e5719b528c7e9d 100644 (file)
@@ -871,7 +871,6 @@ extern void sysrq_sched_debug_show(void);
 extern void sched_init_granularity(void);
 extern void update_max_interval(void);
 extern void update_group_power(struct sched_domain *sd, int cpu);
-extern int update_runtime(struct notifier_block *nfb, unsigned long action, void *hcpu);
 extern void init_sched_rt_class(void);
 extern void init_sched_fair_class(void);