Messages in this thread Patch in this message | | | Date | Wed, 20 Oct 2010 10:13:19 +0600 | Subject | Re: [PATCH] sched_rt: Removes extra checking for nr_cpus_allowed when calling find_lowest_rq | From | Rakib Mullick <> |
| |
On Tue, Oct 19, 2010 at 8:40 PM, Rakib Mullick <rakib.mullick@gmail.com> wrote: > On 10/19/10, Gregory Haskins <ghaskins@novell.com> wrote: >>>>> On 10/19/2010 at 07:02 AM, in message <1287486167.1994.1.camel@twins>, >>>>> Peter >> Zijlstra <peterz@infradead.org> wrote: >>> On Tue, 2010-10-19 at 16:57 +0600, Rakib Mullick wrote: >> > If we made explicit check before calling find_lowest_rq, then I don't > think we need the change that Steve's suggesting. I think explicitly > checking is much more easier and removes extra overhead of function > calling.
The following patch shows what I was trying to say. Please check and comment. Hopefully this looks clean.
--- linus-rc8/kernel/sched_rt.c 2010-10-19 16:42:05.000000000 +0600 +++ rakib-rc8/kernel/sched_rt.c 2010-10-20 10:04:08.000000000 +0600 @@ -1174,9 +1174,6 @@ static int find_lowest_rq(struct task_st int this_cpu = smp_processor_id(); int cpu = task_cpu(task);
- if (task->rt.nr_cpus_allowed == 1) - return -1; /* No other targets possible */ - if (!cpupri_find(&task_rq(task)->rd->cpupri, task, lowest_mask)) return -1; /* No targets found */
@@ -1238,6 +1235,9 @@ static struct rq *find_lock_lowest_rq(st int tries; int cpu;
+ if (task->rt.nr_cpus_allowed < 2) + goto out; + for (tries = 0; tries < RT_MAX_TRIES; tries++) { cpu = find_lowest_rq(task);
@@ -1275,6 +1275,7 @@ static struct rq *find_lock_lowest_rq(st lowest_rq = NULL; }
+out: return lowest_rq; }
Thanks, Rakib
> > Thanks, > Rakib >> Kind Regards, >> -Greg >> >> >> >
| |