|
@@ -3850,7 +3850,11 @@ static void rebalance_domains(int cpu, enum cpu_idle_type idle)
|
|
unsigned long next_balance = jiffies + 60*HZ;
|
|
unsigned long next_balance = jiffies + 60*HZ;
|
|
int update_next_balance = 0;
|
|
int update_next_balance = 0;
|
|
int need_serialize;
|
|
int need_serialize;
|
|
- cpumask_t tmp;
|
|
|
|
|
|
+ cpumask_var_t tmp;
|
|
|
|
+
|
|
|
|
+ /* Fails alloc? Rebalancing probably not a priority right now. */
|
|
|
|
+ if (!alloc_cpumask_var(&tmp, GFP_ATOMIC))
|
|
|
|
+ return;
|
|
|
|
|
|
for_each_domain(cpu, sd) {
|
|
for_each_domain(cpu, sd) {
|
|
if (!(sd->flags & SD_LOAD_BALANCE))
|
|
if (!(sd->flags & SD_LOAD_BALANCE))
|
|
@@ -3875,7 +3879,7 @@ static void rebalance_domains(int cpu, enum cpu_idle_type idle)
|
|
}
|
|
}
|
|
|
|
|
|
if (time_after_eq(jiffies, sd->last_balance + interval)) {
|
|
if (time_after_eq(jiffies, sd->last_balance + interval)) {
|
|
- if (load_balance(cpu, rq, sd, idle, &balance, &tmp)) {
|
|
|
|
|
|
+ if (load_balance(cpu, rq, sd, idle, &balance, tmp)) {
|
|
/*
|
|
/*
|
|
* We've pulled tasks over so either we're no
|
|
* We've pulled tasks over so either we're no
|
|
* longer idle, or one of our SMT siblings is
|
|
* longer idle, or one of our SMT siblings is
|
|
@@ -3909,6 +3913,8 @@ out:
|
|
*/
|
|
*/
|
|
if (likely(update_next_balance))
|
|
if (likely(update_next_balance))
|
|
rq->next_balance = next_balance;
|
|
rq->next_balance = next_balance;
|
|
|
|
+
|
|
|
|
+ free_cpumask_var(tmp);
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
/*
|