Structure storage System of computer system

Source: Internet
Author: User

First, the memory hierarchy

1.1 Storage-level performance parameters

(1) Average price per bit of storage level C

Assuming memory m capacity, access time, per bit price is s,t,c, the average price per bit for the storage hierarchy C

(2) Hit rate H and no hit ratio F

命中率是指CPU在访问存储系统时,在存储器M中找到所需信息的概率。不命中率=1-命中率。

(3) Average time to visit T

Second, "Cache-main Memory" and "main memory-secondary storage" level

2.1 cache-Main Memory

2.2 Main memory-secondary storage

2.3 Comparison

The basic working principle and structure of the cache

Basic structure of the 3.1 cache

在带Cache的存储器中, CPU的访存地址被分割成两部分:① 块地址(块框架地址、块号):用于查找该块在Cache中的位置。② 块内位移(块内偏移量):用于确定所访问的数据在块中的位置。

Working process of 3.2 cache

(1)当CPU需要进行访存时,首先给出主存实地址。(2)地址映像变换机构接收到主存实地址后,根据块号判定所访问的信息字是否在Cache中。若在,通过地址变换机构变换为Cache块地址,在根据块内地址,对Cache进行存取。若不在,则通知访问Cache块失效。然后通过CPU与主存之间的直接数据通路访问主存,将被访问字直接送给CPU,并将包含该字的新块装入Cache。若Cache已满,则通过替换策略实现机构,调出某一Cache块,然后装入所需的块。

3.3 Image Rules

(1) Fully-connected images

全相联映像是指主存中的任一块可以被放置到Cache中的任意一个位置。

(2) Direct image

直接映像是指主存中的每一块只能被放置到Cache中唯一的一个位置。

(3) group-linked images

组相联映像是指主存中的每一块可以被放置到Cache中固定的一个组中的任何一个位置。

3.4 Replacement Policy

(1) Random method

随机选择被替换的块。

(2) Advanced first Out (FIFO)

选择最早调入的块作为被替换的块。

(3) Least Recently used method (LRU)

选择近期最少被访问的块作为被替换的块。

3.5 Write Policy

(1) Write to direct method (WT)

在执行“写”操作时,不仅把信息写入Cache中相应的块,而且也写入下一级存储器中相应的块。

(2) Write back method (WB)

在执行“写”操作时,只把信息写入Cache中相应的块,该块只有在被替换时,才被写回主存。

3.6 data cache, instruction cache, and mixed cache

数据Cache :存放数据的Cache 。指令Cache:存放指令的Cache。混合Cache:既存放数据又存放指令Cache。对数据的访问有读操作和写操作,对指令的访问仅是读操作。所以数据Cache需要进行写操作,而指令Cache则不需要进行写操作。读入指令Cache的指令在块替换出去时不需将Cache中的指令写回主存,而读入数据Cache的数据,在进行块替换时,通常需要写回主存。对相同的容量,指令Cache的命中率比数据Cache的高。将混合Cache分离成指令Cache和数据Cache有助于提高Cache的命中率。

3.7 Cache Performance Analysis

(1) Average access time

平均访问时间=命中时间+失效率×失效开销平均访存时间=指令所占的百分比×(指令命中时间+指令失效率×失效开销)+数据所占的百分比×(数据命中时间+数据失效率×失效开销)

(2) Program execution time
When considering the impact of memory on system performance, the system performance can be described as

CPU时间=(CPU执行周期数+存储器停顿周期数)×时钟周期时间存储器停顿周期数 = “读”的次数 × 读失效率 × 读失效开销 + “写”的次数 × 写失效率 × 写失效开销

If the read, write loss efficiency and read and write failure costs vary significantly

存储器停顿周期数 = 访存次数 × 失效率 × 失效开销CPU时间 = IC × [CPIexe + 访存次数 / 指令数 × 失效率 × 失效开销] × 时钟周期时间

3.8 Cache Optimization

(1) 8 methods to reduce the loss of efficiency

增加Cache块大小提高相联度增加Cache的容量Victim Cache伪相联映像Cache硬件预取编译器控制的预取编译器优化

(2) 5 ways to reduce the cost of failure

读失效优于写写缓冲合并请求字处理技术非阻塞Cache技术采用两级Cache

(3) 4 ways to reduce the hit time

容量小、结构简单的Cache虚拟CacheCache 访问流水化Trace Cache

3.9 Ways to reduce cache failure efficiency

(1) Reasons for failure

1)强制性失效:当第一次访问一个块时,该快不在Cache中,需从下一级存储器中调入Cache,这就是强制性失效。2)容量失效:如果程序执行时所需的块不能全部调入Cache中,则当某些块被替换后,若又重新被访问,就是发生失效,这种失效称为容量失效。3)冲突失效:在组相联或直接映像Cache中,若太多的块映像到同一组中,则会出现该组中的某个块被别的块替换、然后又被重新访问的情况,这样就发生了冲突失效。

(2) Increase the cache block size

(3) Improve the degree of coupling

(4) Increase the cache capacity

(5) Victim Cache

Structure storage System of computer system

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.