美文网首页
segment & vma

segment & vma

作者: 酒桶九筒 | 来源:发表于2017-11-30 23:40 被阅读0次

references:

  1. Process Segments and VMA
  2. Anatomy of a Program in Memory

Each virtual memory area (VMA) is a contiguous range of virtual addresses; these areas never overlap. An instance of vm_area_struct fully describes a memory area, including its start and end addresses, flags to determine access rights and behaviors, and the vm_file field to specify which file is being mapped by the area, if any. A VMA that does not map a file is anonymous. Each memory segment above (e.g., heap, stack) corresponds to a single VMA, with the exception of the memory mapping segment. This is not a requirement, though it is usual in x86 machines. VMAs do not care which segment they are in.

segments

The VMAs are stored in struct vm_area_struct defined in linux/mm.h:

struct vm_area_struct {
        struct mm_struct * vm_mm;       /* The address space we belong to. */
        unsigned long vm_start;         /* Our start address within vm_mm. */
        unsigned long vm_end;           /* The first byte after our end address
                                           within vm_mm. */
        ....
        ....
        ....
        /* linked list of VM areas per task, sorted by address */
        struct vm_area_struct *vm_next;
        struct file *vm_file;
        ....
        ....
} 

The kernel keeps track of the segments which have been allocated to a particular process using the above structures. For each segment, the kernel allocates a VMA. It keeps track of these segments in the mm_struct structures. The kernel tracks the data segment using two variables: start_data and end_data. The code segment boundaries are in the start_code and end_code variables. The stack segment is covered by the single variable start_stack. There is no special variable to keep track of the BSS segment — the VMA corresponding to the BSS accounts for it.

相关文章

  • segment & vma

    references: Process Segments and VMA Anatomy of a Program...

  • vma

    在硬件上,有页表给进程提供虚拟地址空间的映射。在软件上内核也用了一个数据结构来管理进程的虚拟地址空间,它就是vma...

  • UISegmentControl

    常用方法 新增一个文字segment 新增一个图片segment 删除某个segment 删除所有segment ...

  • Okio之Segment

    官方解释 Segment Segment 是 buffer 的切割部分. 每个 buffer 中的 Segment...

  • 麦当娜七分钟演讲悼念杰克逊

    沪江英乐讯 第26届MTV音乐录影带大奖(VMA)的开场永远是最值得人回味的时刻,而邀请VMA的老手麦当娜为开场...

  • LMA与VMA

    LMA英文原版解释:load memory address:the address at which the se...

  • 关于“TCP segment of a reassembled

    关于“TCP segment of a reassembled PDU” 标签:TCP segment of a ...

  • linux学习笔记4-linux程序的典型bug

    segment fault SIGSEGV --- Segment Fault. The possible cas...

  • GStreamer 1.12.4 - playbin2 源代码分

    1. 播放的时间同步 1.1 segment segment是gstreamer定义的一个播放范围。segment...

  • 余弦算法nodejs实现

    // 载入模块var Segment = require('segment');// 创建实例var segmen...

网友评论

      本文标题:segment & vma

      本文链接:https://www.haomeiwen.com/subject/rpgvbxtx.html