caching - 内核可以管理写在TLB条目上的进程ID吗?

标签 caching kernel tlb

出于性能原因,我发现 TLB 包含每个进程的 PID,这意味着将每个进程的 VA 到 PA 映射保留在 TLB 中以节省上下文切换成本。所以,我的问题是内核可以操纵 TLB 中的 PID 条目吗?

我真的很好奇,因为我听说TLB是在MMU内部维护的缓存。请给我答案:)

*我假设 x86 :)

最佳答案

Intel® 64 and IA-32 Architectures Software Developer's Manual

Process-Context Identifiers (PCIDs)

Process-context identifiers (PCIDs) are a facility by which a logical processor may cache information for multiple linear-address spaces. The processor may retain cached information when software switches to a different linear-address space with a different PCID (e.g., by loading CR3; see Section 4.10.4.1 for details). A PCID is a 12-bit identifier.

...

When a logical processor creates entries in the TLBs (Section 4.10.2) and paging structure caches (Section 4.10.3), it associates those entries with the current PCID. When using entries in the TLBs and paging-structure caches to translate a linear address, a logical processor uses only those entries associated with the current PCID

相关:Does Linux use x86 CPU's PCID feature for TLB? If not, why?

关于caching - 内核可以管理写在TLB条目上的进程ID吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34435753/

相关文章:

linux - 如果我在我的内核中进行自定义系统调用和队列,它是线程安全的吗?

c - 在设备驱动程序中使用 kmalloc

java - 从 JAVA 访问 .tlb

com - 如何从 OCX 或 TLB 文件中获取导入的类型库?

assembly - 为什么 INVLPG 至少被调用一次

java - Hibernate一级缓存及get方法

c - 使用 netfilter hook 时打印 skb 数据会使计算机崩溃

JQuery 在 Dom 中缓存 Ajax 请求 + 性能

git - 忽略已经提交到 Git 存储库的文件

Android:与其他应用程序共享数据的存储位置?