O'Reilly logo

Understanding the Linux Kernel, Second Edition by Marco Cesati, Daniel P. Bovet

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required