dogygb 发表于 2008-08-31 21:15

请问应该如何理解“内核中的内存都不分页”--来自Linux内核设计与实现

第二章2.4.3里边提到的,不太理解~~~~~谢谢各位大侠

flw2 发表于 2008-08-31 21:24

看不懂就放弃吧,我看了看,也没看懂,看接下来的解释好了,可能是想说要记得释放,不像用户空间
可能作者写书也没有考虑每句话是否都足够清晰的表达

dogygb 发表于 2008-08-31 21:28

谢谢flw2 ~~~~~

Solaris12 发表于 2008-09-01 12:01

原帖由 dogygb 于 2008-8-31 21:15 发表 http://linux.chinaunix.net/bbs/images/common/back.gif
第二章2.4.3里边提到的,不太理解~~~~~谢谢各位大侠

有英文原文吗?感觉是翻译的问题。

估计是说内核内存都是wired memory,不能page out吧。

flw2 发表于 2008-09-01 12:40

原帖由 Solaris12 于 2008-9-1 12:01 发表 http://linux.chinaunix.net/bbs/images/common/back.gif


有英文原文吗?感觉是翻译的问题。

估计是说内核内存都是wired memory,不能page out吧。
When a user-space application attempts an illegal memory access, the kernel can trap the error, send SIGSEGV, and kill the process. If the kernel attempts an illegal memory access, however, the results are less controlled. (After all, who is going to look after the kernel?) Memory violations in the kernel result in an oops, which is a major kernel error. It should go without saying that you must not illegally access memory, such as dereferencing a NULL pointerbut within the kernel, the stakes are much higher!
Additionally, kernel memory is not pageable. Therefore, every byte of memory you consume is one less byte of available physical memory. Keep that in mind next time you have to add one more feature to the kernel!

albcamus 发表于 2008-09-01 12:40

原帖由 Solaris12 于 2008-9-1 12:01 发表 http://linux.chinaunix.net/bbs/images/common/back.gif


有英文原文吗?感觉是翻译的问题。

估计是说内核内存都是wired memory,不能page out吧。


就是这个意思。 经常听到别人说“分页”,指的是页面是否可以换出。

Solaris12 发表于 2008-09-02 09:10

原帖由 flw2 于 2008-9-1 12:40 发表 http://linux.chinaunix.net/bbs/images/common/back.gif

When a user-space application attempts an illegal memory access, the kernel can trap the error, send SIGSEGV, and kill the process. If the kernel attempts an illegal memory access, however, the ...

page fault在kernel是没办法处理的, 所有的内核内存都是wired memory. 大概就是这个意思.

[ 本帖最后由 Solaris12 于 2008-9-2 09:12 编辑 ]

mik 发表于 2008-09-03 16:53

用户程序一般是 4K 页,linux kernel 的页是多大呀?若设计为 4M 页的话,可以减少换页或不换页吧

zx_wing 发表于 2008-09-03 17:06

原帖由 mik 于 2008-9-3 16:53 发表 http://linux.chinaunix.net/bbs/images/common/back.gif
用户程序一般是 4K 页,linux kernel 的页是多大呀?若设计为 4M 页的话,可以减少换页或不换页吧
用户程序没有页面大小的概念,内核用多大的页用户程序就是多大的页。所以这里4K页是指内核用的页面大小。
linux也支持hugepage以满足有些应用程序使用大页的需求,例如数据库。但一般程序都不需要大页,所以用4M的页面会造成明显的内存浪费

mik 发表于 2008-09-03 17:13

原帖由 zx_wing 于 2008-9-3 17:06 发表 http://linux.chinaunix.net/bbs/images/common/back.gif

用户程序没有页面大小的概念,内核用多大的页用户程序就是多大的页。所以这里4K页是指内核用的页面大小。
linux也支持hugepage以满足有些应用程序使用大页的需求,例如数据库。但一般程序都不需要大页,所以 ...

不是的,OS可以设计为:kernel 的核心组件为 4M,而用户层软件为 4K。
kernel 的核心组件执行代码为 4M 的话可以提高 OS 执行效率,减少 TLBS miss

这可不是我说的,这是 Intel 建议的.:lol:
页: [1] 2 3
查看完整版本: 请问应该如何理解“内核中的内存都不分页”--来自Linux内核设计与实现