问题描述
阅读Mel Gorman
的书Understanding the Linux Virtual Memory Manager
之后,我几乎没有疑问。 4.3 Process Address Space Descriptor
节说kernel threads never page fault or access the user space portion. The only exception is page faulting within the vmalloc space
。以下是我的问题。
-
kenrel线程永远不会出现页面错误:这是否意味着仅用户空间代码会触发页面错误?如果调用
kmalloc()
或vmalloc()
,是否不会出现页面错误?我相信内核必须将这些映射到匿名页面。对此页面执行写操作时,将发生页面错误。我的理解正确吗? -
为什么内核线程无法访问用户空间?
copy_to_user()
或copy_from_user()
不这样做吗? -
Exception is page faulting within vmalloc space
:这是否意味着vmalloc()
会触发页面错误,而kmalloc()
不会?为什么kmalloc()
不会出现页面错误?内核虚拟地址的物理帧不需要保存为页表项吗?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)