From: Steven Rostedt <rostedt@goodmis.org>
To: Hillf Danton <dhillf@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
LKML <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@elte.hu>,
Mike Galbraith <efault@gmx.de>,
Yong Zhang <yong.zhang0@gmail.com>
Subject: Re: [PATCH] sched: remove starvation in check_preempt_equal_prio()
Date: Wed, 25 May 2011 10:13:58 -0400 [thread overview]
Message-ID: <1306332838.1465.99.camel@gandalf.stny.rr.com> (raw)
In-Reply-To: <BANLkTin-feweuE_vm_x1Ex8Yr4ezsJ2wKA@mail.gmail.com>
On Wed, 2011-05-25 at 22:00 +0800, Hillf Danton wrote:
> >
> > Yes, that is the definition of FIFO (First In First Out). The tasks that
> > get to the CPU first run till they voluntarily schedule away, or are
> > preempted by an even high priority task. Tasks of the same priority must
> > wait till the previous task has finished.
> >
>
> Then I try to fix the violation of FIFO, my thought is like below:
>
> ---
> Subject: [PATCH] sched: fix the violation of SCHED_FIFO in
> check_preempt_equal_prio()
>
> Starvation of the same priority tasks is a perfectly valid situation for
> SCHED_FIFO.
>
> If task p is currently running and is a FIFO task, you do not push it
> off for another task of same prio.
> Yes, that is the definition of FIFO (First In First Out). The tasks that
> get to the CPU first run till they voluntarily schedule away, or are
> preempted by an even high priority task. Tasks of the same priority must
> wait till the previous task has finished.
>
No, no, no!
I'm sorry if you misunderstood me. When I said 'finished', I did not
mean that it was truly finished and the process has exited. I simply
meant that finished meant that it scheduled away. Done for the time
being.
Thus, if a task is running of one priority, another task of same
priority will *not* preempt it. If that task schedules for whatever
reason, the next task of same priority will then run, and the first one
will now have to wait for it to schedule away. That is FIFO.
Now we do break this semantic a bit for SMP. If the current task that is
running can be migrated to another CPU, and the one that wakes up is of
same priority but is pinned to this CPU. If we can migrate the running
task to another CPU (another CPU has a lower prio process running), then
we will migrate that task to let the woken task run.
But this is not really preempting the running task, it is more "moving"
it. But there's no real guarantees to what RT tasks do on SMP, so we are
fine.
-- Steve
prev parent reply other threads:[~2011-05-25 14:14 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-24 13:34 Hillf Danton
2011-05-24 13:45 ` Steven Rostedt
2011-05-24 14:11 ` Hillf Danton
2011-05-24 14:22 ` Steven Rostedt
2011-05-24 13:47 ` Peter Zijlstra
2011-05-24 14:01 ` Hillf Danton
2011-05-24 14:24 ` Steven Rostedt
2011-05-24 14:33 ` Hillf Danton
2011-05-24 14:46 ` Steven Rostedt
2011-05-24 15:04 ` Hillf Danton
2011-05-25 14:00 ` Hillf Danton
2011-05-25 14:13 ` Steven Rostedt [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=1306332838.1465.99.camel@gandalf.stny.rr.com \
--to=rostedt@goodmis.org \
--cc=dhillf@gmail.com \
--cc=efault@gmx.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=yong.zhang0@gmail.com \
/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®