From: Rakib Mullick <rakib.mullick@gmail.com>
To: Gregory Haskins <ghaskins@novell.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@elte.hu>, Steven Rostedt <rostedt@goodmis.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] sched_rt: Removes extra checking for nr_cpus_allowed when calling find_lowest_rq
Date: Wed, 20 Oct 2010 10:13:19 +0600 [thread overview]
Message-ID: <AANLkTimcBESMCtr3osZ=4seqT+bSGGix920PDecaSVX_@mail.gmail.com> (raw)
In-Reply-To: <AANLkTi=-E6f3US+h9vzmZhQbzLkaoA4_OZqu8uV3wsjv@mail.gmail.com>
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
>>
>>
>>
>
prev parent reply other threads:[~2010-10-20 4:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-19 10:57 Rakib Mullick
2010-10-19 11:02 ` Peter Zijlstra
2010-10-19 11:12 ` Rakib Mullick
2010-10-19 12:38 ` Steven Rostedt
2010-10-19 12:57 ` Gregory Haskins
2010-10-19 13:01 ` Steven Rostedt
2010-10-19 13:07 ` Gregory Haskins
2010-10-19 14:40 ` Rakib Mullick
2010-10-20 4:13 ` Rakib Mullick [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='AANLkTimcBESMCtr3osZ=4seqT+bSGGix920PDecaSVX_@mail.gmail.com' \
--to=rakib.mullick@gmail.com \
--cc=ghaskins@novell.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®