Hi Richard, thanks for replying. I did go back to see the code and try to
understand what exactly is going on in UML, but still no luck.

The faulted address is covered by one of the vm areas of the task, so it
passed the vma sanity check at the beginning of handle_page_fault(). I
print out the PTEs of the task and I notice one strange thing: when the
fault happens for the first time, the PTE does not exist; the PTE is
present when the second fault happens for the same address (but still a
page fault); in the third page fault (same address), the PTE does not exist
anymore.

So in my case, the faulted address does not require a new vma to be
installed.

Also I've looked into copy_mm() to see how pages are copied from parent
task to its child. I do not understand the purpose of the  the special
mapping installed by UML. It seems that every new task with a new mm_struct
will have one special mapping at the head of its vma list.

Thanks.


On Sun, Apr 7, 2013 at 12:52 PM, richard -rw- weinberger <
richard.weinber...@gmail.com> wrote:

> On Sat, Apr 6, 2013 at 9:23 PM, Terry Hsu <terry.sh...@gmail.com> wrote:
> > Is there any available resource that explains how user-mode-linux maps
> the
> > pages of a task in UML to the host kernel?
>
> The code...? ;)
> UML receives a SIGEGV on the host side if a page is not mapped.
> The SIGEGV handler then installs the mapping using mmap().
>
> > In my UML, I modified a task's page table when forking it. Then I ran
> into a
> > situation where the page fault happens over and over again for the same
> > address in the forked task. I use gdb debugger and find out that when the
> > page fault happens for the first time, the kernel calls do_wp_page() to
> > fault in the page and marks the page present. This should prevent the
> next
> > page fault for the same address from happening again. I checked the PTE
> in
> > UML, they are marked as present so is it possible that the page is not
> being
> > allocated properly on the host kernel so that the page fault keeps
> happening
> > for the same address even though UML thinks the page is present.
> >
> > Any suggestions?
>
> If the same fault happens over and over UML (on the host side) seems
> unable to fix the fault.
> Check the return values of mmap()....
>
> Thanks,
> //richard
>
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

Reply via email to