码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • 【计算机组成与设计】-第五章 memory hierarchy(三)


    5.4 Measuring and Improving Cache Performance

    Cache association

    Cache line的映射方式主要有三种:directed mapping、full associative、set associative。

    可以通过灵活的映射方式来reducing miss rate。

    Directed mapping:

    每个memory block只能存在cache中一个cache line。

    每次加载一个新的memory block,都要把某个cache line替换掉,miss rate较大。

    Full associative:

    每个memory block可以存放在cache中的所有的cache line。

    在确定cache是否hit的时候,需要较多的硬件资源;一般适用于cache line number较少的cache。

    Set-associative 组相连

    一般是n-way set associative(n路组相连)。

    每个set有n个cache line组成,每个memory block可以放在某个set的任何一个cache line中。

    Way代表一个memory block可以放在几个cache line中。

    从另一个角度来说,三种mapping方式都是set -associative,只不过way不同

    Locating block in set associative cache

    在set associative cache中,地址中的index field是用来索引哪个set的,到底是set中的哪个cache line还要通过比对tag来决定。对比tag的过程是同时进行的——如果是4 way,那么需要四个比较器。

    下图中是4way cache,共有256个set。

    Replacing block strategy

    一般是LRU(least recently used)

    Reducing the Miss Penalty Using Multilevel Caches

     In particular, a two-level cache structure allows the primary cache to focus on minimizing hit time to yield a shorter clock cycle or fewer pipeline stages, while allowing the secondary cache to focus on miss rate to reduce the penalty of long memory access times.

    the primary cache of a multilevel cache is often smaller. Furthermore, the primary cache may use a smaller block size, to go with the smaller cache size and also to reduce the miss penalty.

    In comparison, the secondary cache will be much larger than in a single-level cache, since the access time of the secondary cache is less critical.With a larger total size, the secondary cache may use a larger block size than appropriate with a single-level cache. It often uses higher associativity than the primary cache given the focus of reducing miss rates.

    参考:

    1. 计算机组成与设计 第五版 ARM版

  • 相关阅读:
    羧酸研究:Lumiprobe 磺基花青7二羧酸
    Spring Authorization Server优化篇:Redis值序列化器添加Jackson Mixin,解决Redis反序列化失败问题
    LeetCode50天刷题计划第二季(Day 31 — 两数之和 II - 输入有序数组(11.10-11.20)分数到小数(11.30-12.30)
    计算机毕设 机器学习新闻算法实现 - python机器学习 深度学习
    【513. 找树左下角的值】
    分享几个PDF转可编辑word的小妙招
    百度现在应该怎么去做搜索SEO优化?(川圣SEO)蜘蛛池
    java计算机毕业设计医院出入院管理系统源程序+mysql+系统+lw文档+远程调试
    ThinkPHP高仿蓝奏云网盘系统源码/对接易支付系统程序
    【算法——双指针】LeetCode 15 三数之和
  • 原文地址:https://blog.csdn.net/m0_38037810/article/details/126640457
  • 最新文章
  • 攻防演习之三天拿下官网站群
    数据安全治理学习——前期安全规划和安全管理体系建设
    企业安全 | 企业内一次钓鱼演练准备过程
    内网渗透测试 | Kerberos协议及其部分攻击手法
    0day的产生 | 不懂代码的"代码审计"
    安装scrcpy-client模块av模块异常,环境问题解决方案
    leetcode hot100【LeetCode 279. 完全平方数】java实现
    OpenWrt下安装Mosquitto
    AnatoMask论文汇总
    【AI日记】24.11.01 LangChain、openai api和github copilot
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1
正则表达式工具 cron表达式工具 密码生成工具

京公网安备 11010502049817号