From: Jeff Dike <jdike@addtoit.com>
To: John Reiser <jreiser@BitWagon.com>
Cc: uml-devel <user-mode-linux-devel@lists.sourceforge.net>
Subject: Re: [uml-devel] Why does mem_init call map_cb twice?
Date: Fri, 14 Dec 2007 14:34:54 -0500 [thread overview]
Message-ID: <20071214193454.GB7852@c2.user-mode-linux.org> (raw)
In-Reply-To: <4762BDEF.2040003@BitWagon.com>
On Fri, Dec 14, 2007 at 09:31:27AM -0800, John Reiser wrote:
> In arch/um/kernel/mem.c, mem_init calls map_cb twice:
> once directly and once indirectly via initial_thread_cb. Why?
>
> -----
> void mem_init(void)
> {
> /* clear the zero-page */
> memset((void *) empty_zero_page, 0, PAGE_SIZE);
>
> /* Map in the area just after the brk now that kmalloc is about
> * to be turned on.
> */
> brk_end = (unsigned long) UML_ROUND_UP(sbrk(0));
> map_cb(NULL);
> initial_thread_cb(map_cb, NULL);
> -----
It's a bug. That's left over from the tt mode days, when the kernel
ran in the same address spaces as its processes and there was a
separate thread ptracing everything. The tracing thread address space
needed to be kept in sync with the others, and this was one part of
that.
Jeff
--
Work email - jdike at linux dot intel dot com
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
prev parent reply other threads:[~2007-12-14 19:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-14 17:31 [uml-devel] Why does mem_init call map_cb twice? John Reiser
2007-12-14 19:34 ` Jeff Dike [this message]
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=20071214193454.GB7852@c2.user-mode-linux.org \
--to=jdike@addtoit.com \
--cc=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox