Re: doubt regarding VMA

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear Ketan...

> I am extremely sorry. Ofcourse the VMA is shared while cloning the
> process, what I meant was the mm_struct which is inside the
> task_struct. The mm_struct is the one which contains the list of
> VMA's the process can access. And thats what I meant by "copying of
> VMA values"... yeah the wording of my mail was confusing...I agree

Well, actually, you are almost there :) If you read kernel/fork.c on 
copy_mm():
struct mm_struct * mm, *oldmm;
<snip>
oldmm = current->mm;
      <snip>
        if (clone_flags & CLONE_VM) {
                atomic_inc(&oldmm->mm_users);
                mm = oldmm;
           <snip>
               spin_unlock_wait(&oldmm->page_table_lock);
                goto good_mm;
<snip>
good_mm:
        tsk->mm = mm;
        tsk->active_mm = mm;
        return 0;

You can conclude that both mm_struct are actually pointing into single 
structure in memory. How do we know that it is shared? by looking at 
mm_users...:)

regards

Mulyadi


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux