找回密码
 注册
搜索
热搜: 回贴
微赢网络技术论坛 门户 服务器 Linux/BSD 查看内容

Linux下内存使用分布情况

2009-12-20 13:22| 发布者: admin| 查看: 26| 评论: 0|原作者: 仙剑


v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}

Normal
0

7.8 磅
0
2

false
false
false














MicrosoftInternetExplorer4



st1\:*{behavior:url(#ieooui) }
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:普通表格;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
Linux下内存使用分布情况
Linux必须处理如下两种由于硬件存在缺陷而引起的内存寻址问题:
1、 一些硬件只能够使用某些特定的内存地址来执行DMA(直接内存访问)
2、 一些体系结构其内存的物理寻址范围比虚拟寻址范围大得多。这样,就有一些内存不能长久的映射到内核空间
因为这些限制,Linux使用了三种区:
1、 ZONE_DMA,也叫做ZONE_LOW,这个区包含的页能够执行DMA操作
2、 ZONE_NORMAL,这个区包含的都是能正常映射的页
3、 ZONE_HIGHMEM,这个区包含“高端内存”,其中的页并能不长久的映射到内核地址空间
screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://blogimg.chinaunix.net/blog/upfile2/080912203214.png');}" onmousewheel="return imgzoom(this);" alt="" />
2G物理内存的分布情况

遗留下来的DMA
一些老的一些设备需要PC/AT上的DMA控制器才能够进行数据的传输。
这个芯片使用24位地址,由于历史原因,它占用了最低的16M(2^24=16M)
Linux中将这块内存保留为ZONE_LOW,这样使得那些设备能够使用这块内存。

正常内存区
这个区从16M延伸到896M
Linux使用这个区的底下一部分来存放一些跟踪物理内存使用的重要数据结构,它是一个记录数组,名字叫做mem_map[]。
ZONE_NORMAL区剩下的部分就可以供操作系统动态的分配了。

高端内存
Linux传统上尝试将最多的物理内存映射到内核空间。在系统内存小于1G的日子之前的时候,Linux只是简单的将所有的物理内存直接映射到1G的内核地址空间中(3G-4G,
0xC0000000 – 0xFFFFFFFF)。
但是对于2G内存来讲这样就没有空间了。

896M限制
一对特殊的内核函数kmap()和kunmap()可以将“高端”内核地址空间映射到实际的物理内存上。
screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://blogimg.chinaunix.net/blog/upfile2/080912203316.png');}" onmousewheel="return imgzoom(this);" alt="" />
“高端”内核地址空间的临时映射
参考:
http://www.cs.usfca.edu/~cruse/cs635/lesson04.ppt







最新评论

QQ|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏ICP备08020429号 )

GMT+8, 2024-9-30 03:34 , Processed in 0.133662 second(s), 12 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

返回顶部