From: Robert Hancock <hancockrwd@gmail.com>
To: jimmie.davis@l-3com.com, umgwanakikbuti@gmail.com
Cc: oneukum@suse.de, artem_fetishev@epam.com, peterz@infradead.org,
kosaki.motohiro@jp.fujitsu.com, linux-kernel@vger.kernel.org
Subject: Re: Bug 71331 - mlock yields processor to lower priority process
Date: Thu, 27 Mar 2014 00:02:52 -0600 [thread overview]
Message-ID: <5333BF0C.2030102@gmail.com> (raw)
In-Reply-To: <FFF95760268D324AB6DD9426E83C8DF70B2E595F@ARLEXCHMBX01.lst.link.l-3com.com>
On 21/03/14 08:50 AM, jimmie.davis@l-3com.com wrote:>
> ________________________________________
> From: Mike Galbraith [umgwanakikbuti@gmail.com]
> Sent: Friday, March 21, 2014 9:41 AM
> To: Davis, Bud @ SSG - Link
> Cc: oneukum@suse.de; artem_fetishev@epam.com; peterz@infradead.org;
kosaki.motohiro@jp.fujitsu.com; linux-kernel@vger.kernel.org
> Subject: RE: Bug 71331 - mlock yields processor to lower priority process
>
> On Fri, 2014-03-21 at 14:01 +0000, jimmie.davis@l-3com.com wrote:
>
>> If you call mlock () from a SCHED_FIFO task, you expect it to return
>> when done. You don't expect it to block, and your task to be
>> pre-empted.
>
> Say some of your pages are sitting in an nfs swapfile orbiting Neptune,
> how do they get home, and what should we do meanwhile?
>
> -Mike
>
> Two options.
>
> #1. Return with a status value of EAGAIN.
>
> or
>
> #2. Don't return until you can do it.
>
> If SCHED_FIFO is used, and mlock() is called, the intention of the
user is very clear. Run this task until
> it is completed or it blocks (and until a bit ago, mlock() did not
block).
Returning EAGAIN is not something that the API definition from POSIX
allows for, that is only for indicating a failure. If the memory that is
being locked is not currently residing in RAM, then the memory will need
to be swapped in before the call returns, which clearly cannot be done
without blocking. Thus mlock can potentially block, which has not
changed. Whether or not any kernel behavior has changed to cause this to
happen in some cases where it didn't previously, the fact remains that
this is allowed behavior.
Generally real-time applications should not be doing mlock calls during
their real-time execution for that reason. The required memory regions
should be locked during startup so that this kind of execution delay can
be avoided at runtime.
>
> SCHED_FIFO users don't care about fairness. They want the system to
do what it is told.
>
> regards,
> Bud Davis
>
>
>
>
>
>
>
>
>
next prev parent reply other threads:[~2014-03-27 6:03 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-21 20:02 Bug 71331 - mlock yields processor to lower priority process Artem Fetishev
2014-03-21 9:23 ` Mike Galbraith
2014-03-21 12:18 ` jimmie.davis
2014-03-21 13:14 ` Mike Galbraith
2014-03-21 14:34 ` jimmie.davis
2014-03-21 14:54 ` Motohiro Kosaki
2014-03-21 13:35 ` Oliver Neukum
2014-03-21 14:01 ` jimmie.davis
2014-03-21 14:41 ` Mike Galbraith
2014-03-21 14:50 ` jimmie.davis
2014-03-27 0:39 ` Andy Lutomirski
2014-03-27 4:20 ` jimmie.davis
2014-03-27 5:35 ` Mike Galbraith
2014-03-27 6:02 ` Robert Hancock [this message]
2014-03-27 11:37 ` jimmie.davis
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=5333BF0C.2030102@gmail.com \
--to=hancockrwd@gmail.com \
--cc=artem_fetishev@epam.com \
--cc=jimmie.davis@l-3com.com \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oneukum@suse.de \
--cc=peterz@infradead.org \
--cc=umgwanakikbuti@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;
as well as URLs for NNTP newsgroup(s).