LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
123
返回列表 发新帖
楼主: rootding

谈谈大内存的swap的分区方法

[复制链接]
发表于 2005-8-6 11:41:50 | 显示全部楼层
...... 我倒 是可以有16G 内存的
回复 支持 反对

使用道具 举报

发表于 2005-8-6 11:55:08 | 显示全部楼层
Post by 风雨纵横
明显说谎,据我知道内存最多只能有4G,因为CPU寻地范围只能是00000000-FFFFFFFF



他可能不是I386得机器
BTW 当你内存大于等于1G得时候可以不划swap,顶多512M足咦(排除特殊应用)
回复 支持 反对

使用道具 举报

发表于 2005-8-6 15:26:55 | 显示全部楼层
32位机只能寻址 4 GB内存, 但超过 4 GB内存, 操作系统会进行管理.
比如 16G的内存, 虽然只能寻址4GB, 但其它12GB可以进行数据存储, CPU会把最常用的数据放在可以寻到的4GB, 而把不常用的放在其它内存中(以前是放在SWAP区的)

现在变成 cpuregister - cpu chche - 4gb memory - 12gb memory - swap(hard disk)
如果是 64位机当然整个内存都在寻址范围内了, 所以比32机在内存利用上可能更高效一些.

个人认为大内存时需要SWAP与否, 还是看应用, 做SERVER 可以适量给些. 做桌面就不必了.
如果内存超大, 做SERVER也不必给SWAP了吧....呵呵.
回复 支持 反对

使用道具 举报

发表于 2005-8-6 17:16:23 | 显示全部楼层
Post by 弥敦路九号
32位机只能寻址 4 GB内存, 但超过 4 GB内存, 操作系统会进行管理.
比如 16G的内存, 虽然只能寻址4GB, 但其它12GB可以进行数据存储, CPU会把最常用的数据放在可以寻到的4GB, 而把不常用的放在其它内存中(以前是放在SWAP区的)

现在变成 cpuregister - cpu chche - 4gb memory - 12gb memory - swap(hard disk)
如果是 64位机当然整个内存都在寻址范围内了, 所以比32机在内存利用上可能更高效一些.

个人认为大内存时需要SWAP与否, 还是看应用, 做SERVER 可以适量给些. 做桌面就不必了.
如果内存超大, 做SERVER也不必给SWAP了吧....呵呵.



又胡说了,32位机只能寻址 4 GB内存,物理无论你怎么操作系统都只能是4GB最多
CPU寻址,把32位地址编码放入EBX,ECX进行读取,这个是物理限制的,无论用什么操作系统都没用


所谓的超过 4 GB内存,是指swap+物理内存得到的,操作系统可以管理超大的swap
回复 支持 反对

使用道具 举报

发表于 2005-8-6 22:20:42 | 显示全部楼层
楼上的说法欠妥。
32位机和cpu地址总线位数不是一回事,后者才与寻址空间有关。
回复 支持 反对

使用道具 举报

发表于 2005-8-7 16:35:19 | 显示全部楼层
Post by 风雨纵横
又胡说了,32位机只能寻址 4 GB内存,物理无论你怎么操作系统都只能是4GB最多
CPU寻址,把32位地址编码放入EBX,ECX进行读取,这个是物理限制的,无论用什么操作系统都没用


所谓的超过 4 GB内存,是指swap+物理内存得到的,操作系统可以管理超大的swap


welans说的对, 寻址空间取决于地址总线数
物理地址扩展 (PAE) , 是intel Pentium Pro起引入的技术,它把原32根地址总线扩展到了36根.

HIGHMEM solution for using up to 4 GB of memory

Since Linux can't access memory which hasn't been directly mapped
into its address space, to use memory > 1 GB, the physical pages have
to be mapped in the kernel virtual address space first. This means
that the pages in ZONE_HIGHMEM have to be mapped in ZONE_NORMAL before
they can be accessed.

The reserved space which we talked about earlier (in case of x86, 128
MB) has an area in which pages from high memory are mapped into the
kernel address space.

To create a permanent mapping, the "kmap" function is used. Since this
function may sleep, it may not be used in interrupt context. Since the
number of permanent mappings is limited (if not, we could've directly
mapped all the high memory in the address space), pages mapped this
way should be "kunmap"ped when no longer needed.

Temporary mappings can be created via "kmap_atomic". This function
doesn't block, so it can be used in interrupt context. "kunmap_atomic"
un-maps the mapped high memory page. A temporary mapping is only
available as long as the next temporary mapping. However, since the
mapping and un-mapping functions also disable / enable preemption,
it's a bug to not kunmap_atomic a page mapped via kmap_atomic.

3. HIGHMEM solution for using 64 GB of memory

This is enabled via the PAE (Physical Address Extension) extension
of the PentiumPro processors. PAE addresses the 4 GB physical memory
limitation and is seen as Intel's answer to AMD 64-bit and AMD
x86-64. PAE allows processors to access physical memory up to 64 GB
(36 bits of address bus). However, since the virtual address space is
just 32 bits wide, each process can't grow beyond 4 GB. The mechanism
used to access memory from 4 GB to 64 GB is essentially the same as
that of accessing the 1 GB - 4 GB RAM via the HIGHMEM solution
discussed above.

还有
http://www.microsoft.com/whdc/sy ... ver/PAE/pae_os.mspx
回复 支持 反对

使用道具 举报

发表于 2005-8-7 16:48:01 | 显示全部楼层
总之, 32位总线计算机采用超过4GB内存是有可能性.
而swap 分区一般不要超过2GB
回复 支持 反对

使用道具 举报

发表于 2005-8-7 20:26:44 | 显示全部楼层
32 位机器可以使用超过 4G 的内存
有些类似以前 16 位机器使用大内存的技术

更多的去 google 吧



i386 上 Linux 可以使用单个不超过 2G 的 SWAP , 大于 2G 就要分为多个 2G 的 SWAP
回复 支持 反对

使用道具 举报

发表于 2005-8-8 20:31:45 | 显示全部楼层
Post by Yei
这么大的内存还要什么swap啊



应该是系统机制设计方面
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表