Re: doubt regarding VMA

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

 



On 7/13/05, srinivas bakki <srinivas.bakki@xxxxxxxxx> wrote:
> > The only scenario I can think, when two or more processes share VMA of
> > text region (pay attention, you are asking about VMA, not the page or
> > page frame) are in multi threading. Since they execute same code (in
> > most cases, new thread are created with clone() using CLONE_VM), it
> > makes sense to share the text region for efficiency.
> 
> Do you mean the  page tables are shared ? This means they have the
> same page global directory. How is this accomplished ?
> 

Page tables are not owned by any process or thread. They are owned by
kernel in general and any request for mapping the virtual memory to
physical memroy, needs page tables (actually if the translation is not
found in TLB cache)... so no process actually owns the page tables.
They are just global data sturctures.

A VMA structure contains a range of virtual addresses which are
accessible (readable/writable etc) by this process. It has nothing to
do with page tables. So VMA can not be shared even in clone(), rather
it is copied into other process's task_struct. So with clone() you
will have two copies of same VMA values inside both the processes. I
think VMA can never be shared (single instance shared by both
processes).

Please correct me if my understanding is wrong.

HTH
Ketan

--
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