zoukankan      html  css  js  c++  java
  • 虚拟内存(Virtual Memory)

    Each process has its own virtual address space, so the virtual address 0xdead0000 in one process's address space will represent a different physical page than the page represented by 0xdead0000 in another process. Each process has it's own mapping from virtual addresses to physical addresses, virtual addresses are often reused between processes.

    Basic Paramaters
    Symbol Description
    N = 2n Number of addresses in virtual address space
    M = 2m Number of addresses in physical address space
    P = 2p Page size (bytes)
    Components of a virtual address (VA)
    Symbol Description
    VPO Virtual page offset (bytes)
    VPN Virtual page number
    TLBI TLB index
    TLBT TLB tag
    Components of a physical address (PA)
    Symbol Description
    PPO Physical page offset(bytes)
    PPN Physical page number
    CO Byte offset within cache block
    CI Cache index
    CT Cache tag

    As we have seen, every time the CPU generates a virtual address, the MMU must refer to a PTE in order to translate the virtual address into a physical address. In the worst case, this requires an additional fetch from memory, at a cost of tens to hundreds of cycles. If the PTE happens to be cached in L1, then the cost goes down to one or two cycles. However, many systems try to eliminate even this cost by including a small cache of PTEs in the MMU called a translation lookaside buffer (TLB).

    A TLB is a small, virtually addressed cache where each line holds a block consisting of a single PTE. A TLB usually has a high degree of associativity. As shown below, the index and tag fields that are used for set selection and line matching are extracted from the virtual page number in the virtual address. If the TLB has T = 2t sets, then the TLB index (TLBI) consists of the t least significant bits of the VPN, and the TLB tag (TLBT) consists of the remaining bits in the VPN.

    Two-level paging scheme

  • 相关阅读:
    PE文件简介
    hook键盘驱动中的分发函数实现键盘输入数据的拦截
    遍历系统中加载的驱动程序以及通过设备对象指针获取设备对象名称
    如何利用git shell提交代码到github
    驱动开发中的常用操作
    3.1_栈_顺序存储结构(数组形式)
    2.6_链表深入
    2.5_线性表的链式存储结构_双向链表
    2.4_线性表的链式存储结构_单链表具体实现
    2.3_线性表的链式存储结构_单链表
  • 原文地址:https://www.cnblogs.com/null00/p/2749043.html
Copyright © 2011-2022 走看看