aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 154a95fcea7e..67383e7f1ccd 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -3850,7 +3850,11 @@ static void rebalance_domains(int cpu, enum cpu_idle_type idle)
3850 unsigned long next_balance = jiffies + 60*HZ; 3850 unsigned long next_balance = jiffies + 60*HZ;
3851 int update_next_balance = 0; 3851 int update_next_balance = 0;
3852 int need_serialize; 3852 int need_serialize;
3853 cpumask_t tmp; 3853 cpumask_var_t tmp;
3854
3855 /* Fails alloc? Rebalancing probably not a priority right now. */
3856 if (!alloc_cpumask_var(&tmp, GFP_ATOMIC))
3857 return;
3854 3858
3855 for_each_domain(cpu, sd) { 3859 for_each_domain(cpu, sd) {
3856 if (!(sd->flags & SD_LOAD_BALANCE)) 3860 if (!(sd->flags & SD_LOAD_BALANCE))
@@ -3875,7 +3879,7 @@ static void rebalance_domains(int cpu, enum cpu_idle_type idle)
3875 } 3879 }
3876 3880
3877 if (time_after_eq(jiffies, sd->last_balance + interval)) { 3881 if (time_after_eq(jiffies, sd->last_balance + interval)) {
3878 if (load_balance(cpu, rq, sd, idle, &balance, &tmp)) { 3882 if (load_balance(cpu, rq, sd, idle, &balance, tmp)) {
3879 /* 3883 /*
3880 * We've pulled tasks over so either we're no 3884 * We've pulled tasks over so either we're no
3881 * longer idle, or one of our SMT siblings is 3885 * longer idle, or one of our SMT siblings is
@@ -3909,6 +3913,8 @@ out:
3909 */ 3913 */
3910 if (likely(update_next_balance)) 3914 if (likely(update_next_balance))
3911 rq->next_balance = next_balance; 3915 rq->next_balance = next_balance;
3916
3917 free_cpumask_var(tmp);
3912} 3918}
3913 3919
3914/* 3920/*