+ -
当前位置:首页 → 问答吧 → 关于内核在内存分配方面的一些疑问二)

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

时间:2003-03-28

来源:互联网

(1)通常页的尺寸为4KB,这是比较合适的。Pentium支持页尺寸扩展,页的尺寸可到4MB。两种尺寸的页,各有什么特点?或者说采用这两种尺寸的页的场合各有什么特点?

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



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

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

(5)在采用分页机制实现由线性地址到物理地址的转换后,页帧之间可以不连续吗?如果“是”,那么为什么还需要大的内存块?

作者: mjy00   发布时间: 2003-03-28

(2)linux的内核支持三级页表。这样设计的理由是什么?
跨平台,有的机器是三级的。事实上Ppro以后的就可以

作者: 超级用户   发布时间: 2003-04-01

还不是很明白啊,请楼上的介绍清楚一点啊,可以吗?

作者: studying   发布时间: 2003-04-07

4)伙伴内存块分配策略的优点是什么? 有谁能详细讲解一下吗?:

作者: mjy00   发布时间: 2003-04-07

首先,伙伴系统的分配内存是为了尽可能的减小内存分配碎片
而且伙伴系统也便于回收
都是2的幂北~
还是不明白的话,回去补习数据结构。还有2.5好像内存管理要改了

作者: gyb997   发布时间: 2003-04-17

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 .

作者: sudy   发布时间: 2003-04-18

(5)当然可以不连续,大的内存块是为了加快访存速度。

作者: ziyang   发布时间: 2003-04-19