From 4800c72eb53647c5bd78e3508418f1faa17c76e7 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 25 Nov 2008 02:35:11 +1030 Subject: [PATCH] --- yaml --- r: 125321 b: refs/heads/master c: a0e902452da16b79d7c9230630ed8a595d14fa85 h: refs/heads/master i: 125319: 89a0a79e99de55a48161f5d4b5442c7c2b17564e v: v3 --- [refs] | 2 +- trunk/kernel/sched.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 498789e1dd72..e74a6de45a45 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 4d2732c63e0c05cfef2a74868d08eace922dfc3e +refs/heads/master: a0e902452da16b79d7c9230630ed8a595d14fa85 diff --git a/trunk/kernel/sched.c b/trunk/kernel/sched.c index 154a95fcea7e..67383e7f1ccd 100644 --- a/trunk/kernel/sched.c +++ b/trunk/kernel/sched.c @@ -3850,7 +3850,11 @@ static void rebalance_domains(int cpu, enum cpu_idle_type idle) unsigned long next_balance = jiffies + 60*HZ; int update_next_balance = 0; 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) { 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 (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 * longer idle, or one of our SMT siblings is @@ -3909,6 +3913,8 @@ static void rebalance_domains(int cpu, enum cpu_idle_type idle) */ if (likely(update_next_balance)) rq->next_balance = next_balance; + + free_cpumask_var(tmp); } /*