From 2b8f0872149b1ecf67f6453989dd2f116de0cfc3 Mon Sep 17 00:00:00 2001 From: Gregory Haskins Date: Thu, 30 Jul 2009 10:57:28 -0400 Subject: [PATCH] --- yaml --- r: 156253 b: refs/heads/master c: 07903af152b0597d94e9b0030746b63c4664e787 h: refs/heads/master i: 156251: ffa01da65528786f4b9dcb92a3efc1db65ee5fa6 v: v3 --- [refs] | 2 +- trunk/kernel/sched_cpupri.c | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index a1733491e41c..eb9de079fdfd 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e414314cce7539788dd5d2c35decad11782dd858 +refs/heads/master: 07903af152b0597d94e9b0030746b63c4664e787 diff --git a/trunk/kernel/sched_cpupri.c b/trunk/kernel/sched_cpupri.c index e6c251790dde..d014efbf947a 100644 --- a/trunk/kernel/sched_cpupri.c +++ b/trunk/kernel/sched_cpupri.c @@ -81,8 +81,21 @@ int cpupri_find(struct cpupri *cp, struct task_struct *p, if (cpumask_any_and(&p->cpus_allowed, vec->mask) >= nr_cpu_ids) continue; - if (lowest_mask) + if (lowest_mask) { cpumask_and(lowest_mask, &p->cpus_allowed, vec->mask); + + /* + * We have to ensure that we have at least one bit + * still set in the array, since the map could have + * been concurrently emptied between the first and + * second reads of vec->mask. If we hit this + * condition, simply act as though we never hit this + * priority level and continue on. + */ + if (cpumask_any(lowest_mask) >= nr_cpu_ids) + continue; + } + return 1; }