2009년 11월 17일 화요일

vm_area_struct

include/linux/mm_types.h

126 struct vm_area_struct {
127     struct mm_struct * vm_mm;   /* The address space we belong to. */
128     unsigned long vm_start;     /* Our start address within vm_mm. */
129     unsigned long vm_end;       /* The first byte after our end address
130                        within vm_mm. */
131
132     /* linked list of VM areas per task, sorted by address */
133     struct vm_area_struct *vm_next;
134
135     pgprot_t vm_page_prot;      /* Access permissions of this VMA. */
136     unsigned long vm_flags;     /* Flags, see mm.h. */
137
138     struct rb_node vm_rb;
139
140     /*
141      * For areas with an address space and backing store,
142      * linkage into the address_space->i_mmap prio tree, or
143      * linkage to the list of like vmas hanging off its node, or
144      * linkage of vma in the address_space->i_mmap_nonlinear list.
145      */
146     union {
147         struct {
148             struct list_head list;
149             void *parent;   /* aligns with prio_tree_node parent */
150             struct vm_area_struct *head;
151         } vm_set;
152
153         struct raw_prio_tree_node prio_tree_node;
154     } shared;
155
156     /*

157      * A file's MAP_PRIVATE vma can be in both i_mmap tree and anon_vma
158      * list, after a COW of one of the file pages.  A MAP_SHARED vma
159      * can only be in the i_mmap tree.  An anonymous MAP_PRIVATE, stack
160      * or brk vma (with NULL file) can only be in an anon_vma list.
161      */
162     struct list_head anon_vma_node; /* Serialized by anon_vma->lock */
163     struct anon_vma *anon_vma;  /* Serialized by page_table_lock */
164
165     /* Function pointers to deal with this struct. */
166     struct vm_operations_struct * vm_ops;
167
168     /* Information about our backing store: */
169     unsigned long vm_pgoff;     /* Offset (within vm_file) in PAGE_SIZE
170                        units, *not* PAGE_CACHE_SIZE */
171     struct file * vm_file;      /* File we map to (can be NULL). */
172     void * vm_private_data;     /* was vm_pte (shared mem) */
173     unsigned long vm_truncate_count;/* truncate_count or restart_addr */
174
175 #ifndef CONFIG_MMU
176     struct vm_region *vm_region;    /* NOMMU mapping region */
177 #endif
178 #ifdef CONFIG_NUMA
179     struct mempolicy *vm_policy;    /* NUMA policy for the VMA */
180 #endif
181 };

댓글 없음:

댓글 쓰기