Re: usage of vm_area_struct in shared memory

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

 




>     We are aware that the shared memory structure in the IPC array,
>  has a  pointer to the inode which has a cyclic link list of
>  vm_area_structs  of all  processes that have attached to that shared
>  region. Is this array  (vm_next_share or vm_next_prev) really used
>  apart from update_mmu_cache or  vmtruncate_list??

The vm_next_share and vm_pprev_share pointers are not for shared
memory only. They are used to keep track of shared file mappings also.
And vmtruncate_list() is a _real_ use for them: if more than one
process
is mapping the same file and the file got modified (truncated in this
case)
some way of updating the vma's of all those processes is needed.

BTW, I didn't get which IPC array you are refering to. 
 
> Also when and where are the shmem_file_operations like
> shmem_file_read,  shmem_file_map, etc invoked?? Are they by any
> chance related to accessing  the shared memory used in shmget, 
> shmat??? Or shm_open, shm_link??

 If you are using shmget(), shmat(), etc. shmem_file_opearations are
not used. sys_shmget() does get an inode from the shm filesystem, but
it replaces the file operations with shm_file_operations. 
I guess anonymous mmaps (mmapping /dev/zero) and creating/using files
in
/dev/shm will use shmem_file_operations.

Hope this helps,
Ravi.

__________________________________________________
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site
http://webhosting.yahoo.com/
--
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