From: Ingo Molnar <mingo@elte.hu>
To: Darren Hart <dvhltc@us.ibm.com>
Cc: linux-kerneL@vger.kernel.org, Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [RFC PATCH -rt] Priority preemption latency
Date: Sun, 11 Jun 2006 08:37:46 +0200 [thread overview]
Message-ID: <20060611063746.GA11558@elte.hu> (raw)
In-Reply-To: <20060611055828.GA9452@elte.hu>
* Ingo Molnar <mingo@elte.hu> wrote:
> i slept on it meanwhile, and i think the safest would be to also do
> the attached patch ontop of -rt3. This makes the 'kick other CPUs'
> logic totally unconditional - so whatever happens the wakeup code will
> notice if an RT task is in trouble finding the right CPU. Under -rt3
> we'd only run into this branch if we stayed on the same CPU - but
> there can be cases when we have your scenario even in precisely such a
> case. It's rare but possible.
just to elaborate on that possibility a bit more, it's this portion of
the wakeup code that could cause problems:
new_cpu = wake_idle(new_cpu, p);
if (new_cpu != cpu) {
set_task_cpu(p, new_cpu);
task_rq_unlock(rq, &flags);
/* might preempt at this point */
rq = task_rq_lock(p, &flags);
old_state = p->state;
if (!(old_state & state))
at the 'might preempt' point the kernel can go to any other CPU. The
stock kernel does not care because it's really rare and wakeup placement
of tasks is a statistical thing to it. But for RT it's important to get
it right all the time, so my patch removes the RT-overload check from
the else branch to an unconditional place. (I doubt you can trigger it
normally, but it's a possibility nevertheless.)
(i'll do a patch for the upstream scheduler to not re-enable interrupts
at this point [it's a waste of cycles], but even if we couldnt go to
another CPU the whole scheduling scenario might change while we are
trying to acquire the runqueue lock, so it's still beneficial to have
the RT-overload check unconditional.)
Ingo
next prev parent reply other threads:[~2006-06-11 6:38 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-10 0:01 [RFC PATCH -rt] Priority preemption latency Darren Hart
2006-06-10 6:48 ` Ingo Molnar
2006-06-10 7:21 ` Ingo Molnar
2006-06-11 5:49 ` Darren Hart
2006-06-11 5:58 ` Ingo Molnar
2006-06-11 6:37 ` Ingo Molnar [this message]
2006-06-11 6:24 ` Darren Hart
2006-06-11 7:36 ` Ingo Molnar
2006-06-12 15:38 ` Darren Hart
2006-06-15 21:06 ` Mike Kravetz
2006-06-15 22:13 ` Darren Hart
2006-06-15 23:05 ` Esben Nielsen
2006-06-15 22:48 ` Mike Kravetz
2006-07-11 16:48 ` Mike Kravetz
2006-06-12 20:12 ` Mike Kravetz
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=20060611063746.GA11558@elte.hu \
--to=mingo@elte.hu \
--cc=dvhltc@us.ibm.com \
--cc=linux-kerneL@vger.kernel.org \
--cc=tglx@linutronix.de \
/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