aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched
diff options
context:
space:
mode:
authorAlex Shi <alex.shi@intel.com>2012-09-10 03:10:58 -0400
committerIngo Molnar <mingo@kernel.org>2012-09-13 10:52:05 -0400
commitc1cc017c59c44d9ede7003631c43adc0cfdce2f9 (patch)
tree7db4bad5a78af2bdc5197740012e462811422d40 /kernel/sched
parent08bedae1d0acd8c9baf514fb69fa199d0c8345f6 (diff)
sched/nohz: Clean up select_nohz_load_balancer()
There is no load_balancer to be selected now. It just sets the state of the nohz tick to stop. So rename the function, pass the 'cpu' as a parameter and then remove the useless call from tick_nohz_restart_sched_tick(). [ s/set_nohz_tick_stopped/nohz_balance_enter_idle/g s/clear_nohz_tick_stopped/nohz_balance_exit_idle/g ] Signed-off-by: Alex Shi <alex.shi@intel.com> Acked-by: Suresh Siddha <suresh.b.siddha@intel.com> Cc: Venkatesh Pallipadi <venki@google.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1347261059-24747-1-git-send-email-alex.shi@intel.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched')
-rw-r--r--kernel/sched/fair.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 9ae3a5b68ba4..de596a2f626c 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4603,7 +4603,7 @@ static void nohz_balancer_kick(int cpu)
4603 return; 4603 return;
4604} 4604}
4605 4605
4606static inline void clear_nohz_tick_stopped(int cpu) 4606static inline void nohz_balance_exit_idle(int cpu)
4607{ 4607{
4608 if (unlikely(test_bit(NOHZ_TICK_STOPPED, nohz_flags(cpu)))) { 4608 if (unlikely(test_bit(NOHZ_TICK_STOPPED, nohz_flags(cpu)))) {
4609 cpumask_clear_cpu(cpu, nohz.idle_cpus_mask); 4609 cpumask_clear_cpu(cpu, nohz.idle_cpus_mask);
@@ -4643,28 +4643,23 @@ void set_cpu_sd_state_idle(void)
4643} 4643}
4644 4644
4645/* 4645/*
4646 * This routine will record that this cpu is going idle with tick stopped. 4646 * This routine will record that the cpu is going idle with tick stopped.
4647 * This info will be used in performing idle load balancing in the future. 4647 * This info will be used in performing idle load balancing in the future.
4648 */ 4648 */
4649void select_nohz_load_balancer(int stop_tick) 4649void nohz_balance_enter_idle(int cpu)
4650{ 4650{
4651 int cpu = smp_processor_id();
4652
4653 /* 4651 /*
4654 * If this cpu is going down, then nothing needs to be done. 4652 * If this cpu is going down, then nothing needs to be done.
4655 */ 4653 */
4656 if (!cpu_active(cpu)) 4654 if (!cpu_active(cpu))
4657 return; 4655 return;
4658 4656
4659 if (stop_tick) { 4657 if (test_bit(NOHZ_TICK_STOPPED, nohz_flags(cpu)))
4660 if (test_bit(NOHZ_TICK_STOPPED, nohz_flags(cpu))) 4658 return;
4661 return;
4662 4659
4663 cpumask_set_cpu(cpu, nohz.idle_cpus_mask); 4660 cpumask_set_cpu(cpu, nohz.idle_cpus_mask);
4664 atomic_inc(&nohz.nr_cpus); 4661 atomic_inc(&nohz.nr_cpus);
4665 set_bit(NOHZ_TICK_STOPPED, nohz_flags(cpu)); 4662 set_bit(NOHZ_TICK_STOPPED, nohz_flags(cpu));
4666 }
4667 return;
4668} 4663}
4669 4664
4670static int __cpuinit sched_ilb_notifier(struct notifier_block *nfb, 4665static int __cpuinit sched_ilb_notifier(struct notifier_block *nfb,
@@ -4672,7 +4667,7 @@ static int __cpuinit sched_ilb_notifier(struct notifier_block *nfb,
4672{ 4667{
4673 switch (action & ~CPU_TASKS_FROZEN) { 4668 switch (action & ~CPU_TASKS_FROZEN) {
4674 case CPU_DYING: 4669 case CPU_DYING:
4675 clear_nohz_tick_stopped(smp_processor_id()); 4670 nohz_balance_exit_idle(smp_processor_id());
4676 return NOTIFY_OK; 4671 return NOTIFY_OK;
4677 default: 4672 default:
4678 return NOTIFY_DONE; 4673 return NOTIFY_DONE;
@@ -4833,7 +4828,7 @@ static inline int nohz_kick_needed(struct rq *rq, int cpu)
4833 * busy tick after returning from idle, we will update the busy stats. 4828 * busy tick after returning from idle, we will update the busy stats.
4834 */ 4829 */
4835 set_cpu_sd_state_busy(); 4830 set_cpu_sd_state_busy();
4836 clear_nohz_tick_stopped(cpu); 4831 nohz_balance_exit_idle(cpu);
4837 4832
4838 /* 4833 /*
4839 * None are in tickless mode and hence no need for NOHZ idle load 4834 * None are in tickless mode and hence no need for NOHZ idle load