Memory Regions

Linux implements a memory region by means of an object of type vm_area_struct; its fields are shown in Table 8-3.

Table 8-3. The fields of the memory region object

Type

Field

Description

struct mm_struct *

vm_mm

Pointer to the memory descriptor that owns the region

unsigned long

vm_start

First linear address inside the region

unsigned long

vm_end

First linear address after the region

struct vm_area_struct *

vm_next

Next region in the process list

pgprot_t

vm_page_prot

Access permissions for the page frames of the region

unsigned long

vm_flags

Flags of the region

rb_node_t

vm_rb

Data for the red-black tree (see later in this chapter)

struct vm_area_struct *

vm_next_share

Pointer to the next element in the file memory mapping list

struct vm_area_struct **

vm_pprev_share

Pointer to previous element in the file memory mapping list

struct vm_operations_struct *

vm_ops

Pointer to the methods of the memory region

unsigned long

vm_pgoff

Offset in mapped file, if any (see Chapter 15)

struct file *

vm_file

Pointer to the file object of the mapped file, if any

unsigned long

vm_raend

End of current read-ahead window of the mapped file (see Section 15.2.4)

void *

vm_private_data

Pointer to private data of the memory region

Each memory region descriptor identifies a linear address interval. The vm_start field contains the first linear address of the interval, while the vm_end field ...

Get Understanding the Linux Kernel, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.