4GB/4GB内核VM拆分 [英] 4GB/4GB Kernel VM Split

查看:133
本文介绍了4GB/4GB内核VM拆分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友

我看到Ingo Molnar撰写的这篇文章,他是著名的Linux内核爱好者,他谈到4GB. /4GB分割.

I saw this article by Ingo Molnar, a famous Linux Kernel enthusiast where he talks about 4GB/4GB split.

在这篇文章中,他说

使用4G/4G补丁,可以在4G/4G模式下编译内核,其中 如果有一个完整的,独立的4GB内核虚拟机,并且 单独的完整(和每个进程)4GB VM用于用户空间.

with the 4G/4G patch, the kernel can be compiled in 4G/4G mode, in which case there's a full, separate 4GB VM for the kernel, and there are separate full (and per-process) 4GB VMs for user-space.

我的问题从这里开始:

  1. 我的假设是像Linux一样,在整体内核中,进程的 kernel user 部分共享相同的PROCESS地址空间.因此,对于没有没有此4G/4G补丁的Linux内核,我们分别为用户虚拟空间和内核虚拟空间分配了3/1.
    实际上,内核的1GB虚拟空间已映射到每个进程的虚拟地址空间中.简而言之,PROCESS ADDRESS SPACE是4GB,其中1GB被分配给内核.是真的吗?

  1. My assumption was that in a monolithic kernel like as in Linux, the kernel and user part of process shares same PROCESS ADDRESS SPACE. So with a Linux kernel that does not have this 4G/4G patch, we have 3/1 split for user virtual space and kernel virtual space respectively.
    In fact kernel's 1GB virtual space is mapped in every process' virtual address space. Put it simple, PROCESS ADDRESS SPACE is 4GB, out which 1GB is allotted to kernel. Is it true?

按问题中的文章进行操作-如果我的假设如1)中所述是正确的-他是不是意味着内核地址空间不再映射到PROCESS ADDRESS SPACE中,而我们有一个不同的虚拟地址空间内核,并且没有共享地址空间?
那就是PROCESS ADDRESS SPACE是4GB,而KERNEL ADDRESS SPACE是另外4GB.而不是将PROCESS ADDRESS SPACE扩大到8GB的事实,其中4GB是为内核共享的.

Going by the article in the question - and if my assumption as said in 1) is right - does he mean that the kernel address space is no more mapped into PROCESS ADDRESS SPACE and we have a different virtual address space for kernel and there is no sharing of address space?
That is PROCESS ADDRESS SPACE is 4GB and KERNEL ADDRESS SPACE is another 4GB; rather than the fact that PROCESS ADDRESS SPACE has enlarged to become 8GB out of which 4GB is shared for kernel.

我知道我在这里听起来有点愚蠢:).

I know I am sounding bit stupid here :).

推荐答案

如果我正确理解了这篇文章,则补丁之后内核和用户空间不会共享相同的地址空间.但是,这需要在每次用户空间/系统切换期间切换页表.

If I understand the article correctly, the kernel and the userspace don't share the same address space after the patch. This however costs switching page tables during each userspace/system switch.

这篇关于4GB/4GB内核VM拆分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆