diff options
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/sched/fair.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 7982faf7223b..a3a41c61a2c9 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c | |||
| @@ -6788,6 +6788,11 @@ out_unlock: | |||
| 6788 | return 0; | 6788 | return 0; |
| 6789 | } | 6789 | } |
| 6790 | 6790 | ||
| 6791 | static inline int on_null_domain(struct rq *rq) | ||
| 6792 | { | ||
| 6793 | return unlikely(!rcu_dereference_sched(rq->sd)); | ||
| 6794 | } | ||
| 6795 | |||
| 6791 | #ifdef CONFIG_NO_HZ_COMMON | 6796 | #ifdef CONFIG_NO_HZ_COMMON |
| 6792 | /* | 6797 | /* |
| 6793 | * idle load balancing details | 6798 | * idle load balancing details |
| @@ -6842,8 +6847,13 @@ static void nohz_balancer_kick(void) | |||
| 6842 | static inline void nohz_balance_exit_idle(int cpu) | 6847 | static inline void nohz_balance_exit_idle(int cpu) |
| 6843 | { | 6848 | { |
| 6844 | if (unlikely(test_bit(NOHZ_TICK_STOPPED, nohz_flags(cpu)))) { | 6849 | if (unlikely(test_bit(NOHZ_TICK_STOPPED, nohz_flags(cpu)))) { |
| 6845 | cpumask_clear_cpu(cpu, nohz.idle_cpus_mask); | 6850 | /* |
| 6846 | atomic_dec(&nohz.nr_cpus); | 6851 | * Completely isolated CPUs don't ever set, so we must test. |
| 6852 | */ | ||
| 6853 | if (likely(cpumask_test_cpu(cpu, nohz.idle_cpus_mask))) { | ||
| 6854 | cpumask_clear_cpu(cpu, nohz.idle_cpus_mask); | ||
| 6855 | atomic_dec(&nohz.nr_cpus); | ||
| 6856 | } | ||
| 6847 | clear_bit(NOHZ_TICK_STOPPED, nohz_flags(cpu)); | 6857 | clear_bit(NOHZ_TICK_STOPPED, nohz_flags(cpu)); |
| 6848 | } | 6858 | } |
| 6849 | } | 6859 | } |
| @@ -6897,6 +6907,12 @@ void nohz_balance_enter_idle(int cpu) | |||
| 6897 | if (test_bit(NOHZ_TICK_STOPPED, nohz_flags(cpu))) | 6907 | if (test_bit(NOHZ_TICK_STOPPED, nohz_flags(cpu))) |
| 6898 | return; | 6908 | return; |
| 6899 | 6909 | ||
| 6910 | /* | ||
| 6911 | * If we're a completely isolated CPU, we don't play. | ||
| 6912 | */ | ||
| 6913 | if (on_null_domain(cpu_rq(cpu))) | ||
| 6914 | return; | ||
| 6915 | |||
| 6900 | cpumask_set_cpu(cpu, nohz.idle_cpus_mask); | 6916 | cpumask_set_cpu(cpu, nohz.idle_cpus_mask); |
| 6901 | atomic_inc(&nohz.nr_cpus); | 6917 | atomic_inc(&nohz.nr_cpus); |
| 6902 | set_bit(NOHZ_TICK_STOPPED, nohz_flags(cpu)); | 6918 | set_bit(NOHZ_TICK_STOPPED, nohz_flags(cpu)); |
| @@ -7159,11 +7175,6 @@ static void run_rebalance_domains(struct softirq_action *h) | |||
| 7159 | nohz_idle_balance(this_rq, idle); | 7175 | nohz_idle_balance(this_rq, idle); |
| 7160 | } | 7176 | } |
| 7161 | 7177 | ||
| 7162 | static inline int on_null_domain(struct rq *rq) | ||
| 7163 | { | ||
| 7164 | return !rcu_dereference_sched(rq->sd); | ||
| 7165 | } | ||
| 7166 | |||
| 7167 | /* | 7178 | /* |
| 7168 | * Trigger the SCHED_SOFTIRQ if it is time to do periodic load balancing. | 7179 | * Trigger the SCHED_SOFTIRQ if it is time to do periodic load balancing. |
| 7169 | */ | 7180 | */ |
