From 32ecdd16401a5efab8cdc24a58c8236945a94511 Mon Sep 17 00:00:00 2001 From: "Siddha, Suresh B" Date: Sat, 10 Sep 2005 00:26:21 -0700 Subject: [PATCH] --- yaml --- r: 8355 b: refs/heads/master c: fa3b6ddc3f4a8eadba52234134cdb59c28b5332d h: refs/heads/master i: 8353: 21449da142793534ec59d92b4d8c5312b07ba3aa 8351: 684e7c488a01c6c53a100321a418dc6dd87f50f3 v: v3 --- [refs] | 2 +- trunk/kernel/sched.c | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 99f090a33897..1cf99b6fafd8 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5927ad78ec75870b1bdfa65a10ad1300cd664d36 +refs/heads/master: fa3b6ddc3f4a8eadba52234134cdb59c28b5332d diff --git a/trunk/kernel/sched.c b/trunk/kernel/sched.c index 103f705b245c..1dc29dec38a9 100644 --- a/trunk/kernel/sched.c +++ b/trunk/kernel/sched.c @@ -2125,6 +2125,16 @@ static int load_balance(int this_cpu, runqueue_t *this_rq, if (unlikely(sd->nr_balance_failed > sd->cache_nice_tries+2)) { spin_lock(&busiest->lock); + + /* don't kick the migration_thread, if the curr + * task on busiest cpu can't be moved to this_cpu + */ + if (!cpu_isset(this_cpu, busiest->curr->cpus_allowed)) { + spin_unlock(&busiest->lock); + all_pinned = 1; + goto out_one_pinned; + } + if (!busiest->active_balance) { busiest->active_balance = 1; busiest->push_cpu = this_cpu; @@ -2165,6 +2175,8 @@ static int load_balance(int this_cpu, runqueue_t *this_rq, schedstat_inc(sd, lb_balanced[idle]); sd->nr_balance_failed = 0; + +out_one_pinned: /* tune up the balancing interval */ if ((all_pinned && sd->balance_interval < MAX_PINNED_INTERVAL) || (sd->balance_interval < sd->max_interval)) @@ -2357,7 +2369,8 @@ static void rebalance_tick(int this_cpu, runqueue_t *this_rq, if (j - sd->last_balance >= interval) { if (load_balance(this_cpu, this_rq, sd, idle)) { - /* 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 * not idle. */