public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Zan Lynx <zlynx@acm.org>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Jan-Benedict Glaw <jbglaw@lug-owl.de>,
	Marc-Jano Knopp <pub_ml_lkml@marc-jano.de>,
	Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [Bug] mlockall() not working properly in 2.6.x
Date: Mon, 19 Dec 2005 11:38:35 -0700	[thread overview]
Message-ID: <1135017515.13318.11.camel@localhost> (raw)
In-Reply-To: <1135014451.6051.23.camel@localhost.localdomain>

[-- Attachment #1: Type: text/plain, Size: 1181 bytes --]

On Mon, 2005-12-19 at 17:47 +0000, Alan Cox wrote:
> On Llu, 2005-12-19 at 18:27 +0100, Jan-Benedict Glaw wrote:
> > > > that we did this because inheriting MCL_FUTURE is standards-incorrect.
> > > 
> > > Oh! So how can I make programs unswappable with kernel 2.6.x then?
> > 
> > That would mean that you cannot just exec() another program that will
> > also be mlockall()ed. The new program has to do that on its own...
> 
> mlockall MCL_FUTURE applies to this image only and the 2.6 behaviour is
> correct if less useful in some ways. It would be possible to add an
> inheriting MCL_ flag that was Linux specific but then how do you control
> the depth of inheritance ? If that isn't an issue it looks the easiest.
> 
> Another possibility would be pmlockall(pid, flag), but that looks even
> more nasty if it races an exec.

How about clearing MCL_FUTURE on fork but allow exec to inherit it?
That way a parent process could fork, mlockall in the child and exec a
memlocked child.  A regular fork,exec by a memlocked parent would not
create a memlocked child.

Seems less messy than a new flag, while keeping the benefits.
-- 
Zan Lynx <zlynx@acm.org>

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2005-12-19 18:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-18 21:21 [Bug] mlockall() not working properly in 2.6.x Marc-Jano Knopp
2005-12-19 10:21 ` Andrew Morton
2005-12-19 11:42   ` Marc-Jano Knopp
2005-12-19 17:27     ` Jan-Benedict Glaw
2005-12-19 17:47       ` Alan Cox
2005-12-19 18:38         ` Zan Lynx [this message]
2005-12-19 19:48           ` Alan Cox

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=1135017515.13318.11.camel@localhost \
    --to=zlynx@acm.org \
    --cc=akpm@osdl.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=jbglaw@lug-owl.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pub_ml_lkml@marc-jano.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