3G/1G虚拟机拆分有什么优势? 32位Linux内核 [英] What's the advantage of 3G/1G vm split ? 32bit linux kernel

查看:78
本文介绍了3G/1G虚拟机拆分有什么优势? 32位Linux内核的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

虚拟内存I:问​​题[LWN.net] http://lwn.net/Articles/75174/

Virtual Memory I: the problem [LWN.net] http://lwn.net/Articles/75174/

尤其是,硬件的地址转换缓冲区可以在内核和用户空间之间共享.

in particular, the hardware's address translation buffer can be shared between the kernel and user space.

我对此完全感到困惑.为什么在拆分虚拟机时他们可以共享TLB?我知道某些CPU中有页面全局位

I am totally confused about it. Why they can share the TLB when the vm is split? I know there is page global bit in some CPU that

表示TLB条目对于不同的进程是通用的,不需要刷新.

indicating TLB entries are common to different process and need not to be flushed.

TLB和vm split 3G/1G之间有什么关系?请详细评论.预先感谢.

What is the relation between TLB and vm split 3G/1G? Please comment in detail. Thanks in advance.

更新:为什么不使用页面全局位来指示OS(内核空间)正在使用TLB条目?如果是这样,为什么还需要拆分虚拟机空间?示例:TLB中有两个条目(vm线性地址相同),但其中之一设置了全局位. ?当上下文切换时,只需刷新未设置全局位的条目即可.这可能吗?

Update:why not use page global bit to indicate the TLB entry is used by OS(kernel space)? If so, why do still need to split the vm space? example: two entry(vm liner address is same) in TLB but one of them the global bit is set. ? When the context switch, just flush the entries that the global bit is not set. Is this possible?

Update2:我检查了intel-ia-32体系结构软件开发人员手册,发现TLB条目中没有全局位(存在于PDE和PTE中).但是,当上下文切换时,CPU如何确定TLB条目全局位是置位还是未置位?

Update2:I checked the intel-ia-32 architectures software developer manual and found that there is no global bit(exists in PDE and PTE) in TLB entry. But when the context switch, how the CPU determine whether TLB entry global bit set or unset?

推荐答案

TLB还包含一个管理器标志,该标志指示常规进程是否可以使用该映射,或者仅当具有管理器标志的进程运行该映射时才可用设置-即进程在内核上下文中执行时.

The TLB also includes a supervisor flag that indicates if the mapping can be used by regular processes or if it is only usable when a process is running with the supervisor flag set -- i.e., when the process is executing in kernel context.

此超级用户标志允许TLB在该过程中都有用(它不会自动获得对内核千兆字节中数据的特权) 并允许内核完全访问所有在内核模式下执行时,进程的内存.

This supervisor flag allows the TLB to be useful for both the process (it doesn't automatically get privileges to the data in the kernel's gigabyte) and allows the kernel to have complete access to all the process's memory when executing in kernel mode.

这意味着进程可以进入和退出内核模式,而不会产生TLB刷新惩罚.

This means a process can enter and exit kernel mode without incurring TLB flush penalties.

如果未拆分内存(例如,使用了4:4补丁程序,它将4 GB的空间提供给用户空间,将4 GB的空间提供给内核空间),则必须在每个内核进入/退出时刷新TLB,以映射特权空间或用户空间所有复制到内核和从内核复制的数据必须经过繁琐的重新映射机制.

If the memory was not split (say, the 4:4 patch giving four gigabytes to userspace and four gigabytes to kernel space is in use) then the TLB must be flushed on every kernel enter / exit to map either the privileged space or the userspace and all data being copied into and out of the kernel must go through tedious remapping mechanisms.

这篇关于3G/1G虚拟机拆分有什么优势? 32位Linux内核的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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