LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1241|回复: 6

关于内核在内存分配方面的一些疑问二)

[复制链接]
发表于 2003-3-28 16:49:32 | 显示全部楼层 |阅读模式
(1)通常页的尺寸为4KB,这是比较合适的。Pentium支持页尺寸扩展,页的尺寸可到4MB。两种尺寸的页,各有什么特点?或者说采用这两种尺寸的页的场合各有什么特点?

(2)linux的内核支持三级页表。这样设计的理由是什么?



(3)阅读分配物理页帧的代码,__alloc_pages() 。当区域没有足够内存块时,它是如何处理的?

(4)伙伴内存块分配策略的优点是什么?

(5)在采用分页机制实现由线性地址到物理地址的转换后,页帧之间可以不连续吗?如果“是”,那么为什么还需要大的内存块?
发表于 2003-4-1 19:03:14 | 显示全部楼层
(2)linux的内核支持三级页表。这样设计的理由是什么?
跨平台,有的机器是三级的。事实上Ppro以后的就可以
发表于 2003-4-7 00:27:26 | 显示全部楼层
还不是很明白啊,请楼上的介绍清楚一点啊,可以吗?
 楼主| 发表于 2003-4-7 14:58:55 | 显示全部楼层

4)伙伴内存块分配策略的优点是什么?

4)伙伴内存块分配策略的优点是什么? 有谁能详细讲解一下吗?:
发表于 2003-4-17 10:30:02 | 显示全部楼层
首先,伙伴系统的分配内存是为了尽可能的减小内存分配碎片
而且伙伴系统也便于回收
都是2的幂北~
还是不明白的话,回去补习数据结构。还有2.5好像内存管理要改了
发表于 2003-4-18 13:22:57 | 显示全部楼层
1. Extended paging is used to translate large contiguous linear address ranges into corresponding physical ones; in these cases, the kernel can do without intermediate Page Tables and thus save memory and preserve TLB entries
2。the position of the Page Middle Directory in the sequence of pointers is kept so that the same code can work on 32-bit and 64-bit architectures
4。the buddy system is a reasonable compromise to overcome the disadvantages of both the fixed and variable partitioning schemes. it has found application in parallel systems as an efficent means of the allocation and realease for parallel programs .a modified form of the buddy system is used for unix kernel memory allocation(cite from os internals and design principles)
5.yes .
发表于 2003-4-18 21:40:57 | 显示全部楼层
(5)当然可以不连续,大的内存块是为了加快访存速度。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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