2.4 copy mm 初始化 vma

1891阅读 0评论2011-11-14 zylthinking
分类:LINUX


  41struct vm_area_struct {
  42        struct mm_struct * vm_mm;       /* VM area parameters */ ===================================> 设置为新申请的 mm
  43        unsigned long vm_start;
  44        unsigned long vm_end;
  45
  46        /* linked list of VM areas per task, sorted by address */
  47        struct vm_area_struct *vm_next; ============================================================> NULL
  48
  49        pgprot_t vm_page_prot;
  50        unsigned long vm_flags;       ==============================================================> 清除 VM_LOCKED 标志
  51
  52        /* AVL tree of VM areas per task, sorted by address */
  53        short vm_avl_height;          ===============================> 垃圾值
  54        struct vm_area_struct * vm_avl_left; ========================> 但没关系, 因为 mm->mmap_avl 在进入函数时就设置为了NULL
  55        struct vm_area_struct * vm_avl_right;========================> 而在 build_avl_tree 时, 这些值又会被更新
  56
  57        /* For areas with an address space and backing store,
  58         * one of the address_space->i_mmap{,shared} lists,
  59         * for shm areas, the list of attaches, otherwise unused.
  60         */
  61        struct vm_area_struct *vm_next_share;   ===================================================> 插入到父任务
  62        struct vm_area_struct **vm_pprev_share; ===================================================> vm_area_struct 之后
  63
  64        struct vm_operations_struct * vm_ops;
  65        unsigned long vm_pgoff;         /* offset in PAGE_SIZE units, *not* PAGE_CACHE_SIZE */
  66        struct file * vm_file;
  67        unsigned long vm_raend;
  68        void * vm_private_data;         /* was vm_pte (shared mem) */
  69};
  70
上一篇:ABI
下一篇:先存起来, 似乎有用