linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
To: Christoph Lameter <clameter@engr.sgi.com>
Cc: linux-mm <linux-mm@kvack.org>
Subject: Re: [RFC] [PATCH 2.6.20-mm2] Optionally inherit mlockall() semantics across fork()/exec()
Date: Fri, 23 Feb 2007 09:58:01 -0500	[thread overview]
Message-ID: <1172242682.5059.19.camel@localhost> (raw)
In-Reply-To: <Pine.LNX.4.64.0702221507080.22567@schroedinger.engr.sgi.com>

On Thu, 2007-02-22 at 15:09 -0800, Christoph Lameter wrote:
> On Thu, 22 Feb 2007, Lee Schermerhorn wrote:
> 
> > Add an int to mm_struct to remember inheritance of future locks.
> 
> Should that not go into the task_struct rather than into mm_struct? 
> If you run your gizmo on a thread then all other threads of the process 
> will also be pinned.

Well, you currently can't run it on a thread--i.e., no way to affect an
existing task/thread.  It only works when launching an application.  I
have considered how to apply it to a running process, but I wanted to
float this proposal first.

The semantics of mlockall(), whether you use the '_CURRENT and/or the
'_FUTURE flag, apply to the entire address space of the process.  [See
http://www.opengroup.org/onlinepubs/7990989775/xsh/mlockall.html]  The
patch enables inheritance of these semantics across fork() [CURRENT] and
exec() [FUTURE].

> 
> Or put it into the vma like VM_MLOCK and inherit it when vmas are copied.

Again, mlockall(MCL_FUTURE) sets def_flags in the mm_struct so that it
applies to the entire address space.  Without this patch, dup_mm()
unconditionally removes the VM_LOCKED flags from vmas, in keeping with
the specified semantics of fork().  The MCL_INHERIT flag overrides this
particular semantic, and leaves the VM_LOCKED flag untouched in the
duplicated vmas.

Lee

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2007-02-23 14:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-22 21:03 [RFC] [PATCH 2.6.20-mm2] Optionally inherit mlockall() semantics across fork()/exec() Lee Schermerhorn
2007-02-22 23:09 ` Christoph Lameter
2007-02-23 14:58   ` Lee Schermerhorn [this message]
2007-02-23 19:16     ` Christoph Lameter

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=1172242682.5059.19.camel@localhost \
    --to=lee.schermerhorn@hp.com \
    --cc=clameter@engr.sgi.com \
    --cc=linux-mm@kvack.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;
as well as URLs for NNTP newsgroup(s).