vm_insert_page – insert single page into user vma

1. vm_insert_page - insert single page into user vma


int vm_insert_page(struct vm_area_struct * vma, unsigned long addr, struct page * page);

vma  user vma to map to

addr  target user address of this page

page  source kernel page


2. Classroom


The  virtual  memory  area   (VMA)  is  the  kernel  data
structure used to manage  distinct regions of a process's
address space.  A VMA represents a  homogeneous region in
the virtual  memory of a  process: a contiguous  range of
virtual addresses that have the same permission flags and
are backed  up by the same  object (a file,  say, or swap
space).  It  corresponds  loosely  to the  concept  of  a
"segment," although  it is better described  as "a memory
object  with its  own properties."  The memory  map  of a
process is made up of (at least) the following areas:

An area for the program's executable code (often called text)

Multiple areas for data, including initialized data (that
which has  an explicitly assigned value  at the beginning
of  execution),  uninitialized  data  (BSS),[3]  and  the
program stack

[3]  The name  BSS  is  a historical  relic  from an  old
assembly operator meaning  "block started by symbol." The
BSS segment of executable files isn't stored on disk, and
the kernel maps the zero page to the BSS address range.

One area for each active memory mapping

related source: http://www.makelinux.net/ldd3/chp-15-sect-1

Leave a comment

Your email address will not be published. Required fields are marked *