From 8daf34b6f55862ae11e8ea929467d76bb69bf456 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 25 Mar 2009 15:01:22 +1030 Subject: [PATCH] --- yaml --- r: 142909 b: refs/heads/master c: 13b8bd0a5713bdf05659019badd7c0407984ece1 h: refs/heads/master i: 142907: e046c8e581fb7c3de8c4ae2266b0851cf562d83c v: v3 --- [refs] | 2 +- trunk/kernel/sched_cpupri.c | 5 +++-- trunk/kernel/sched_rt.c | 15 ++++----------- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/[refs] b/[refs] index 9acd70e76e57..a22f65e8ad1c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a18b83b7ef3c98cd8b4bb885e4a649a8f30fb7b0 +refs/heads/master: 13b8bd0a5713bdf05659019badd7c0407984ece1 diff --git a/trunk/kernel/sched_cpupri.c b/trunk/kernel/sched_cpupri.c index 1e00bfacf9b8..cdd3c89574cd 100644 --- a/trunk/kernel/sched_cpupri.c +++ b/trunk/kernel/sched_cpupri.c @@ -55,7 +55,7 @@ static int convert_prio(int prio) * cpupri_find - find the best (lowest-pri) CPU in the system * @cp: The cpupri context * @p: The task - * @lowest_mask: A mask to fill in with selected CPUs + * @lowest_mask: A mask to fill in with selected CPUs (or NULL) * * Note: This function returns the recommended CPUs as calculated during the * current invokation. By the time the call returns, the CPUs may have in @@ -81,7 +81,8 @@ int cpupri_find(struct cpupri *cp, struct task_struct *p, if (cpumask_any_and(&p->cpus_allowed, vec->mask) >= nr_cpu_ids) continue; - cpumask_and(lowest_mask, &p->cpus_allowed, vec->mask); + if (lowest_mask) + cpumask_and(lowest_mask, &p->cpus_allowed, vec->mask); return 1; } diff --git a/trunk/kernel/sched_rt.c b/trunk/kernel/sched_rt.c index bac1061cea2f..fbec5a58ff10 100644 --- a/trunk/kernel/sched_rt.c +++ b/trunk/kernel/sched_rt.c @@ -805,20 +805,15 @@ static int select_task_rq_rt(struct task_struct *p, int sync) static void check_preempt_equal_prio(struct rq *rq, struct task_struct *p) { - cpumask_var_t mask; - if (rq->curr->rt.nr_cpus_allowed == 1) return; - if (!alloc_cpumask_var(&mask, GFP_ATOMIC)) - return; - if (p->rt.nr_cpus_allowed != 1 - && cpupri_find(&rq->rd->cpupri, p, mask)) - goto free; + && cpupri_find(&rq->rd->cpupri, p, NULL)) + return; - if (!cpupri_find(&rq->rd->cpupri, rq->curr, mask)) - goto free; + if (!cpupri_find(&rq->rd->cpupri, rq->curr, NULL)) + return; /* * There appears to be other cpus that can accept @@ -827,8 +822,6 @@ static void check_preempt_equal_prio(struct rq *rq, struct task_struct *p) */ requeue_task_rt(rq, p, 1); resched_task(rq->curr); -free: - free_cpumask_var(mask); } #endif /* CONFIG_SMP */