All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Reiser <jreiser@BitWagon.com>
To: user-mode-linux-devel@lists.sourceforge.net
Subject: [uml-devel] why allocate page for stack in clone(, stack, ~CLONE_VM & (...)) ?
Date: Thu, 01 Nov 2007 15:05:32 -0700	[thread overview]
Message-ID: <472A4DAC.3060104@BitWagon.com> (raw)

In arch/um/os/start_up.c, function start_ptraced_child() does:
        pid = clone(ptrace_child, (void *) sp, SIGCHLD, NULL);
where sp points into a newly- mmap()ed page.  Instead, why not
avoid the mmap() entirely via:
        pid = clone(ptrace_child, NULL,        SIGCHLD, NULL);

Because the flags to clone() do not contain CLONE_VM, then the clone()
is equivalent to a fork() with respect to address space.  The child does not
share VM with the parent, and using the same addresses for the stack
causes no overwrites.  Perhaps the Dcache efficiency is slightly
less, but much less costly than mmap() and the eventual munmap().

-- 
John Reiser, jreiser@BitWagon.com

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

             reply	other threads:[~2007-11-01 22:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-01 22:05 John Reiser [this message]
2007-11-02  2:25 ` [uml-devel] why allocate page for stack in clone(, stack, ~CLONE_VM & (...)) ? Jeff Dike

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=472A4DAC.3060104@BitWagon.com \
    --to=jreiser@bitwagon.com \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.