All of lore.kernel.org
 help / color / mirror / Atom feed
* [uml-devel] why allocate page for stack in clone(, stack, ~CLONE_VM & (...)) ?
@ 2007-11-01 22:05 John Reiser
  2007-11-02  2:25 ` Jeff Dike
  0 siblings, 1 reply; 2+ messages in thread
From: John Reiser @ 2007-11-01 22:05 UTC (permalink / raw)
  To: user-mode-linux-devel

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-11-02  2:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-01 22:05 [uml-devel] why allocate page for stack in clone(, stack, ~CLONE_VM & (...)) ? John Reiser
2007-11-02  2:25 ` Jeff Dike

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.