Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
All information related to the process address space is included in an object called the memory descriptor of type mm_struct. This object is referenced by the mm field of the process descriptor. The fields of a memory descriptor are listed in Table 9-2.
| Type | Field | Description |
|---|---|---|
| struct vm_area_struct * | mmap | Pointer to the head of the list of memory region objects |
| struct rb_root | mm_rb | Pointer to the root of the red-black tree of memory region objects |
| struct vm_area_struct * | mmap_cache | Pointer to the last referenced memory region object |
| unsigned long (*)( ) | get_unmapped_area | Method that searches an available linear address interval in the process address space |
| void (*)( ) | unmap_area | Method invoked when releasing a linear address interval |
| unsigned long | mmap_base | Identifies the linear address of the first allocated anonymous memory region or file memory mapping (see the section "Program Segments and Process Memory Regions" in Chapter 20) |
| unsigned long | free_area_cache | Address from which the kernel will look for a free interval of linear addresses in the process address space |
| pgd_t * | pgd | Pointer to the Page Global Directory |
| atomic_t | mm_users | Secondary usage counter |
| atomic_t | mm_count | Main usage counter |
| int | map_count | Number of memory regions |
| struct rw_semaphore | mmap_sem | Memory regions' read/write semaphore |
| spinlock_t | page_table_lock | Memory regions' and Page Tables' spin lock |
| struct list_head | mmlist | Pointers to adjacent elements in the list of memory descriptors |
| unsigned long | start_code | Initial address of executable code |
| unsigned long | end_code | Final address of executable code |
| unsigned long | start_data | Initial address of initialized data |
| unsigned long | end_data | Final address of initialized data |
| unsigned long | start_brk | Initial address of the heap |
| unsigned long | brk | Current final address of the heap |
| unsigned long | start_stack | Initial address of User Mode stack |
| unsigned long | arg_start | Initial address of command-line arguments |
| unsigned long | arg_end | Final address of command-line arguments |
| unsigned long | env_start | Initial address of environment variables |
| unsigned long | env_end | Final address of environment variables |
| unsigned long | rss | Number of page frames allocated to the process |
| unsigned long | anon_rss | Number of page frames assigned to anonymous memory mappings |
| unsigned long | total_vm | Size of the process address space (number of pages) |
| unsigned long | locked_vm | Number of "locked" pages that cannot be swapped out (see Chapter 17) |
| unsigned long | shared_vm | Number of pages in shared file memory mappings |
| unsigned long | exec_vm | Number of pages in executable memory mappings |
| unsigned long | stack_vm | Number of pages in the User Mode stack |
| unsigned long | reserved_vm | Number of pages in reserved or special memory regions |
| unsigned long | def_flags | Default access flags of the memory regions |
| unsigned long | nr_ptes | Number of Page Tables of this process |
| unsigned long [] | saved_auxv | Used when starting the execution of an ELF program (see Chapter 20) |
| unsigned int | dumpable | Flag that specifies whether the process can produce a core dump of the memory |
| cpumask_t | cpu_vm_mask | Bit mask for lazy TLB switches (see Chapter 2) |
| mm_context_t | context | Pointer to table for architecture-specific information (e.g., LDT's address in 80 — 86 platforms) |
| unsigned long | swap_token_time | When this process will become eligible for having the swap token (see the section "The Swap Token" in Chapter 17) |
| char | recent_pagein | Flag set if a major Page Fault has recently occurred |
| int | core_waiters | Number of lightweight processes that are dumping the contents of the process address space to a core file (see the section "Deleting a Process Address Space" later in this chapter) |
| struct completion * | core_startup_done | Pointer to a completion used when creating a core file (see the section "Completions" in Chapter 5) |
| struct completion | core_done | Completion used when creating a core file |
| rwlock_t | ioctx_list_lock | Lock used to protect the list of asynchronous I/O contexts (see Chapter 16) |
| struct kioctx * | ioctx_list | List of asynchronous I/O contexts (see Chapter 16) |
| struct kioctx | default_kioctx | Default asynchronous I/O context (see Chapter 16) |
| unsigned long | hiwater_rss | Maximum number of page frames ever owned by the process |
| unsigned long | hiwater_vm | Maximum number of pages ever included in the memory regions of the process |