ruach
ruach

Reputation: 1469

Can kernel manages Process id written on TLB entry?

I've found that TLB contains PID of each process for performance reason, which means by leaving each process's VA to PA mappings in TLB for saving context-switching cost. So, my question is can kernel manipulate that PID entries in TLB?

I am really curious because I have heard that TLB is a cache maintained inside MMU. Please give me answer :)

*I assume x86 :)

Upvotes: 2

Views: 778

Answers (1)

Remus Rusanu
Remus Rusanu

Reputation: 294307

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

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

Upvotes: 3

Related Questions