zoukankan      html  css  js  c++  java
  • 昨天CSAPP上的疑问的解答

    昨天CSAPP上的疑问的解答

    今天整明白了。

    CSAPP英文版第2版,826页,或者中文版第2版546页,有这么一段。关于多级页表的。

    "But if we had a 32-bit address space, 4KB pages, and a 4-byte PTE[page table entry, 杨注], then we would need a 4MB page table resident in memory at all time..."

    其中"32-bit address space"的意思是 2^32 bytes,而不是2^32 bits,因为内存是按字节而不是按比特寻址的。

    根据公式:页表尺寸 = (地址空间 / 页尺寸) * PTE入口大小........公式1

    32-bit address space: 2^32 bytes (昨天误作bits)
    4KB pages: 4K bytes
    a 4-byte: 4 bytes
    B: bytes



    K = 2^10
    M = 2^22

    代入公式1的右侧,得

    (2^32 bytes / 4K bytes) * 4 bytes
        = 2^32 * 2^2 / (2^2 * 2^10) bytes
        = 2^22 bytes
        = 2^2 M bytes
        = 4MB


    --------------------


    博客会手工同步到以下地址:


    [http://giftdotyoung.blogspot.com]


    [http://blog.csdn.net/younggift]

  • 相关阅读:
    docker-compose 命令详解
    Ubuntu 安装 rabbitmq
    scrapy.cmdline.execute
    queue.Queue()
    多线程通信
    多线程(thread+queue 售票)
    协程
    线程
    利用Nginx实现反向代理web服务器
    利用Nginx实现反向代理web服务器
  • 原文地址:https://www.cnblogs.com/jiangu66/p/3206518.html
Copyright © 2011-2022 走看看