Understanding page frames and pages
Memory in Linux is organized in the form of pages (typically 4 KB in size). Contiguous linear addresses within a page are mapped onto contiguous physical addresses on the RAM chip. However contiguous pages can be present anywhere on the physical RAM. Access
rights and physical address mapping in the kernel is done at a page level rather than for every linear address. A page refers both to the set of linear addresses that it contains as well as to the data contained in this group of addresses.
The paging unit thinks of all physical RAM as partitioned into fixed-length page frames. Each page frame contains a page. A page frame is a constituent of main memory, and hence it is a storage area. It is important to distinguish a page from a page frame;
the former is just a block of data, which may be stored in any page frame or on disk. The paging unit translates linear addresses into physical ones. One key task in the unit is to check the requested access type against the access rights of the linear address.
If the memory access is not valid, it generates a Page Fault exception (see Chapter 4 and Chapter 8). The data structures that map linear to physical addresses are called page tables ; they are stored in main memory and must be properly initialized by the
kernel before enabling the paging unit.
Pages can optionally be 4 MB in size. However this is not advised except for applications where the expected data unit is large.
The kernel considers the following page frames as reserved:
Those falling in the unavailable physical address ranges
Those containing the kernel's code and initialized data structures
A page contained in a reserved page frame can never be dynamically assigned or swapped to disk. As a general rule, the Linux kernel is installed in RAM starting from the physical address 0x00100000 i.e., from the second megabyte. The total number of page frames
required depends on how the kernel is configured. A typical configuration yields a kernel that can be loaded in less than 3 MB of RAM
The remaining portion of the RAM barring the reserved page frames is called dynamic memory. It is a valuable resource, needed not only by the processes but also by the kernel itself. In fact, the performance of the entire system depends on how efficiently dynamic
memory is managed. Therefore, all current multitasking operating systems try to optimize the use of dynamic memory, assigning it only when it is needed and freeing it as soon as possible.
The kernel must keep track of the current status of each page frame. For instance, it must be able to distinguish the page frames that are used to contain pages that belong to processes from those that contain kernel code or kernel data structures. Similarly,
it must be able to determine whether a page frame in dynamic memory is free. A page frame in dynamic memory is free if it does not contain any useful data. It is not free when the page frame contains data of a User Mode process, data of a software cache, dynamically
allocated kernel data structures, buffered data of a device driver, code of a kernel module, and so on
Understanding page frames and pages的更多相关文章
- Windows Phone 8.1 Page transitions
original: http://www.visuallylocated.com/post/2014/06/24/Page-transitions-and-animations-in-Windows- ...
- 工作于内存和文件之间的页缓存, Page Cache, the Affair Between Memory and Files
原文作者:Gustavo Duarte 原文地址:http://duartes.org/gustavo/blog/post/what-your-computer-does-while-you-wait ...
- Page Cache, the Affair Between Memory and Files
Previously we looked at how the kernel manages virtual memory for a user process, but files and I/O ...
- System and method to prioritize large memory page allocation in virtualized systems
The prioritization of large memory page mapping is a function of the access bits in the L1 page tabl ...
- DrawingControl控件在Add Page时报故障的问题
Visio二次开发用到了Drawing Control控件.在控件上添加新页面时,visual编译器报内存保护故障“尝试读取或写入受保护的内存.这通常指示其他内存已损坏.”,这个问题困扰了我很久,最后 ...
- Operating System Memory Management、Page Fault Exception、Cache Replacement Strategy Learning、LRU Algorithm
目录 . 引言 . 页表 . 结构化内存管理 . 物理内存的管理 . SLAB分配器 . 处理器高速缓存和TLB控制 . 内存管理的概念 . 内存覆盖与内存交换 . 内存连续分配管理方式 . 内存非连 ...
- UNDERSTANDING POSTGRESQL.CONF: CHECKPOINT_SEGMENTS, CHECKPOINT_TIMEOUT, CHECKPOINT_WARNING
While there are some docs on it, I decided to write about it, in perhaps more accessible language – ...
- error RC1205: invalid code page
Get followings error and warnings when building project: error RC1205: invalid code pagewarning C400 ...
- selenium page object model
Page Object Model (POM) & Page Factory in Selenium: Ultimate Guide 来源:http://www.guru99.com/page ...
随机推荐
- Linux学习--第二波
虽然安装的centos感觉不能上网,权限也不知道怎么设置. 偶然的机会发现了一个好东西,博客:http://www.cnblogs.com/xiaoluo501395377/tag/CentOS/.有 ...
- effective c++:dynamic_cast,避免返回handles指向对象内部
关于dynamic_cast 假定我们有一个基类指针bp,我们在运行时需要把它转换成他的派生类指针,这个时候需要用到dynamic_cast. Derived *dp = dynamic_cast&l ...
- 2013年19个最棒的HTML5网站模板免费下载
上次我们整理了14个HTML5奉献给大家下载了,今天我再给大家整理了19个2013最新的HTML5模板供有需要的朋友下载使用,它们涉及不同的行业的模板需求,支持手机设备,十分精美! 1. Affini ...
- dedecms list 判断 每隔3次输出内容
{dede:list pagesize='12' runphp='yes'} [field:global name=autoindex runphp="yes"](@me%3==0 ...
- c++声明与定义
c++声明与定义 声明是将一个名称引入程序.定义提供了一个实体在程序中的唯一描述.声明和定义有时是同时存在的. 如 int a; extern int b=1; 只有当extern中不存在初始化才是 ...
- Northwind数据库表字段介绍
① Categories:种类表 相应字段: CategoryID :类型ID: CategoryName:类型名; Description:类型说明; Picture:产品样本 ② Customer ...
- HD1013Digital Roots
Problem Description The digital root of a positive integer is found by summing the digits of the int ...
- Tagged Pointers
[Tagged Pointers] 1.what is tagged pointer? 2.原理剖析
- HDU1896Stones(优先队列)
地址http://acm.hdu.edu.cn/showproblem.php?pid=1896 题目大一比较简单,就是说在一条直线道路上有n个石头,往前走,遇到一个数一个,如果遇到的是第奇数个那就把 ...
- POJ1651Multiplication Puzzle(区间DP)
比较好做的区间DP 状态转移方程:DP[i][j] 表示区间[i,j]最小的乘积和. DP[i][j] = MIN{DP[i][k-1]+DP[k+1][j] + a[k]*a[i-1]*a[j+1] ...