当前位置:网站首页>Network equipment hard core technology insider router Chapter 18 dpdk and its prequel (III)
Network equipment hard core technology insider router Chapter 18 dpdk and its prequel (III)
2022-07-27 15:28:00 【User 8289326】
We found that , In these issues , We mentioned repeatedly cache.
Cache refer to CPU Internal cache . This concept is a combination of DRAM At the same time .
Let's review 《 Fundamentals of digital electronic technology 》 in , About RAM Chapter of ——
SRAM Of S, Is static (static) It means , It's also synchronous (Sync) It means . Synchronization refers to ,CPU adopt WR or RD Line direction RAM Send a read-write signal ,RAM Immediately according to Address The address of the line , and Data Line data , Write content to the inside , Or change the internal content from data Line feedback to CPU.SRAM Inside each bit from 6 Transistor composition , As shown in the figure below :
Another kind RAM be called DRAM,D by Dymanic Abbreviation .DRAM Each bit It only needs 1 A transistor , As shown in the figure below :
obviously ,DRAM Than SRAM The cost is low , Low power consumption , High integration .
Mr. Lu Xun pointed out : There are no two sweet sugarcane in the world .DRAM The cost of saving costs and power consumption is ,CPU visit DRAM Time for , About to visit SRAM The time of the 10-100 times .
To make up for it CPU and DRAM Performance loss caused by working speed difference , Engineers are again CPU and DRAM A layer is designed between SRAM, It's called cache (cache).SRAM Its working principle is to use temporal locality and spatial locality .
What is temporal locality ? In short , After a piece of memory is accessed , In the near future , It has a high probability of being visited again , The probability of being visited decreases with time .
such as ,XX Students let A After the technician pinches his feet , Next time, come to the pedicure shop , Still looking A Technicians have a high probability of pinching their feet ……
such as , My little sister let Tony After the teacher does the hairstyle , Next time, come to the barber shop , Still looking Tony The probability of teachers is relatively high ……
What is spatial locality ? In short , After a piece of memory is accessed , Its adjacent memory area also has a relatively high probability of being accessed again , The probability of being visited decreases as the offset increases .
such as ,XX After my classmates went to the foot shop , The probability of going to the health care products store next door is relatively high ……
such as , Little sister has been to Tony After the teacher's barber shop , The probability of going to the milk tea shop next door is relatively high ……
Get down to business . Time locality determines Cache The effectiveness of the mechanism : If the low-speed memory , Just visited the content , Temporarily stored in high-speed memory , that , Because the system has a high probability of accessing these contents next time , This can greatly improve the performance of the system .
And spatial locality determines cache Organization style : If the contents in the low-speed memory , In blocks of a certain size , Stored in high-speed memory , And the storage order is the same , that , Because the system has a high probability of accessing adjacent content , This can also greatly improve the performance of the system .
In red “ In blocks of a certain size ”, It refers to the cache organization we have repeatedly mentioned ——Cacheline.
Cacheline And primary storage through fully associative mapping 、 Direct mapping or group associative mapping .
Fully associative mapping refers to , Any main memory block can be mapped to any cacheline, However, due to the need to introduce CAM The mechanism of , The cost rises sharply .
Direct mapping refers to , Any main memory block , Can only be mapped to one cacheline, If two main memory blocks are mapped to the same cache line, And frequently used , It's going to happen cache ping-pong The phenomenon of .
Group associative mapping is a balanced design mechanism , A main memory block can be stored in a unique Cache Any line in the group . In practice , This method is more common .
Let's get back to the point , stay DPDK in , in the light of Cache Optimization of is the highlight . Starting tomorrow , We are right. DPDK Make a comprehensive introduction .
边栏推荐
- 基于stm32的数字示波器设计方案
- 网络设备硬核技术内幕 路由器篇 5 汤普金森漫游网络世界(上)
- Leetcode 74. search two-dimensional matrix bisection /medium
- JMeter recording interface automation
- DIY ultra detailed tutorial on making oscilloscope: (1) I'm not trying to make an oscilloscope
- Unity performance optimization ----- LOD (level of detail) of rendering optimization (GPU)
- USB接口电磁兼容(EMC)解决方案
- Watermelon book machine learning reading notes Chapter 1 Introduction
- Network equipment hard core technology insider router Chapter 7 tompkinson roaming the network world (Part 2)
- 光电隔离电路设计方案(六款基于光耦、AD210AN的光电隔离电路图)
猜你喜欢

The design method of integral operation circuit is introduced in detail

积分运算电路的设计方法详细介绍
USB接口电磁兼容(EMC)解决方案

EMC design scheme of RS485 interface

Digital storage oscilloscope based on FIFO idt7202-12

谷歌团队推出新Transformer,优化全景分割方案|CVPR 2022

Unity性能优化------渲染优化(GPU)之Occlusion culling(遮挡剔除)

reflex

Dialog manager Chapter 3: create controls

IJCAI 2022 outstanding papers were published, and 298 Chinese mainland authors won the first place in two items
随机推荐
Leetcode 190. reverse binary bit operation /easy
3D相关的简单数学知识
Lua study notes
Two stage submission and three stage submission
Leetcode 191. number of 1 bits bit operation /easy
网络设备硬核技术内幕 路由器篇 5 汤普金森漫游网络世界(上)
Introduction to STM32 learning can controller
LeetCode 74. 搜索二维矩阵 二分/medium
Leetcode 783. binary search tree node minimum distance tree /easy
Dialog manager Chapter 3: create controls
Network equipment hard core technology insider router Chapter 5 tompkinson roaming the network world (Part 1)
网络设备硬核技术内幕 路由器篇 4 贾宝玉梦游太虚幻境(下)
Kubernetes CNI classification / operation mechanism
Leetcode 456.132 mode monotone stack /medium
Four kinds of relay schemes driven by single chip microcomputer
DIY ultra detailed tutorial on making oscilloscope: (1) I'm not trying to make an oscilloscope
Cap theory and base theory
3.3-5v转换
EMC design scheme of RS485 interface
LeetCode 341.扁平化嵌套列表迭代器 dfs,栈/ Medium