当前位置:网站首页>网络设备硬核技术内幕 路由器篇 19 DPDK(四)
网络设备硬核技术内幕 路由器篇 19 DPDK(四)
2022-07-27 14:05:00 【用户8289326】
在DPDK中,对cache的主要优化,除了利用时间局部性和空间局部性以外,更重要的是,要避免多核对缓存的ping-pong式读写。
昨天提到,如果理发店的tony老师上一次让小姐姐非常满意,那么,下一次小姐姐访问tony老师的概率将大大增加。这就是cache加速指令执行的秘籍。
但是,如果有多个小姐姐同时看上了tony老师,则会导致大家在tony老师身后排队。更加雪上加霜的是,tony老师刚刚为前一个小姐姐做完发型的时候,手是脏的,需要清洗后才可以为下一个小姐姐服务。
是的,我们在说多核同时写入一条高速缓存行的情况。
对于多核同时写入一条高速缓存行的情景,由于缓存一致性的要求,当核A写入高速缓存后,需要确保高速缓存的内容与RAM一致。高速缓存管理单元会将这块RAM在其他处理器核维护的高速缓存行标记为dirty,需要做清洁(flush)才可以让下一个core使用。
这段时间的开销是多少呢?我们知道,cache是用来解决RAM读写延迟和CPU运行速度之间的差异的。对于cache命中的情况,CPU里面的ALU可以立即从cache读取,但未命中则需要从DRAM读取,经历MMU地址转换-DRAM控制器写入行地址-写入列地址-读写的过程。这大约会损失100个CPU指令周期。
为了避免前面提到的小姐姐排队等待tony老师洗手造成的弊端,方法是很好解决的:给每一个小姐姐分配一个喜欢的老师就行了,可以是小P老师,kevin老师,加藤鹰老师,东尼大木老师…
因此,我们可以为不同的core分配不同的缓存。
除了在前面提到的,对于计数器等多个核可能并发访问的数据结构,小姐姐们还喜欢争抢的一位老师是,网卡的收发队列。
一般地,每个网卡的MAC芯片至少有8个队列。
但是,我们知道,对于Intel的至强处理器,每颗CPU的核数可能多达28核,以超线程论则可能达到56个线程。2路的服务器会有112个线程。显然,8个tony老师无法满足112个小姐姐的需求。
怎么办呢?
且听下回分解。
边栏推荐
- Is it safe for Guosen Securities to open a mobile account? Is Zhongshan securities reliable
- 自动化配置SSH免密登录和取消SSH免密配置脚本
- 【云享读书会第13期】多媒体处理工具 FFmpeg 工具集
- Get the data of the first frame of unity's open camera
- Passive income: return to the original and safe two ways to earn
- @Bean 与 @Component 用在同一个类上,会发生什么?
- JS what is declaration in advance? The order of function and variable declaration in advance (the foreshadowing of execution context)
- 股票买卖4
- User question understanding and answer content organization for epidemic disease Science Popularization
- 正则表达式:邮箱匹配
猜你喜欢

Why is there no unified quotation for third-party testing fees of software products?

这年头谁还不会抓包,WireShark 抓包及常用协议分析送给你!

Nokia's patent business was hit for the first time, and Chinese enterprises are not so easy to knead

如果我们是那晚负责修复 B 站崩了的开发人员

Understand JS execution context in an article

How to do well in enterprise system vulnerability assessment

Redis

周鸿祎:数字安全能力落后也会挨打

Win11壁纸变黑怎么办?Win11壁纸变黑了的解决方法

Lecture 4: Longest ascending substring
随机推荐
MySQL save data prompt: out of range value for column error
C语言基础练习题目
JS what is declaration in advance? The order of function and variable declaration in advance (the foreshadowing of execution context)
SkyWalking分布式系统应用程序性能监控工具-中
The database uses PSQL and JDBC to connect remotely and disconnect automatically from time to time
Skywalking distributed system application performance monitoring tool - medium
Summary of basic knowledge of C language
Get the data of the first frame of unity's open camera
Document translation__ Salt and pepper image denoising based on adaptive total variation L1 regularization
视觉系统设计实例(halcon-winform)-9.文字显示
Visual system design example (Halcon WinForm) -9. text display
How to help enterprises optimize office management
Annual comprehensive analysis of China's online video market in 2022
Understand the evolution of redis architecture in one article
【WORK】关于技术架构
关于印发《深圳市工业和信息化局绿色制造试点示范管理暂行办法》的通知
Tencent two sides: @bean and @component are used in the same class, what will happen?
NEFU118 n! How many zeros are there after [basic theorem of arithmetic]
Automatically configure SSH password free login and cancel SSH password free configuration script
DVWA full level customs clearance tutorial