From a user perspective, the address space is a flat linear set of addresses which may be used but the kernel's perspective is slightly differently. The linear address space is split into two parts, the userspace part which changes with each context switch and the kernel address space which remains constant. The location of the split is determined by the value of PAGE_OFFSET which is 3GB on the x86. This means that 3GB is available for the process to use the the remaining 1GB is always mapped by the kernel.
The address space usable by the process is managed by a high level mm_struct which is roughly analogous to the vmspace struct in BSD[#!mckusick96!#].
Each address space consists of a number of page aligned regions of memory that are in use. They never overlap and represent a set of addresses which contain pages that are related to each other in terms of protection and purpose. These regions are represented by a struct vm_area_struct and is roughly analogous to the vm_map_entry struct in BSD. For clarity, a region may represent the process heap for use with malloc, a memory mapped file such as a shared library or a block of anonymous memory allocated with mmap(). The pages in the region may have been never allocation, are present and in use or swapped out to disk.
If a region is backed by a file, its
vm_file field will be set. By traversing
vm_filef_dentry
d_inode
i_mapping,
the associated address_space for the region may be
obtained. The address_space has all the filesystem specific
information required to perform page based operations on disk.
A number of system calls are provided which affect the address space and regions which are listed in Table 9.1