Intel CMT & CAT & CDP 技术应用

原文:https://blog.csdn.net/force_eagle/article/details/77197833
Intel CMT & CAT & CDP 技术

Intel Cache Monitoring Technology (CMT) and Cache Allocation Technology (CAT)

查看当前系统 L3 cache 详情

pqos -v
NOTE: Mixed use of MSR and kernel interfaces to manage
CAT or CMT & MBM may lead to unexpected behavior.
INFO: CACHE: type 1, level 1, max id sharing this cache 2 (1 bits)
INFO: CACHE: type 2, level 1, max id sharing this cache 2 (1 bits)
INFO: CACHE: type 3, level 2, max id sharing this cache 2 (1 bits)
INFO: CACHE: type 3, level 3, max id sharing this cache 32 (5 bits)
INFO: Monitoring capability detected
INFO: CPUID.0x7.0: L3 CAT supported
INFO: CDP is disabled
INFO: L3 CAT details: CDP support=1, CDP on=0, #COS=16, #ways=20, ways contention bit-mask 0xc0000
INFO: L3 CAT details: cache size 26214400 bytes, way size 1310720 bytes
INFO: L3CA capability detected
INFO: CPUID 0x10.0: L2 CAT not supported!
INFO: L2CA capability not detected
INFO: CPUID 0x10.0: MBA not supported!
INFO: MBA capability not detected
INFO: resctrl not detected. Kernel version 4.10 or higher required
INFO: OS support for CMT detected
INFO: OS support for L3 CAT not detected
INFO: resctrl not mounted
WARN: Hijacking performance counters on core 0
WARN: Hijacking performance counters on core 1
WARN: Hijacking performance counters on core 2
WARN: Hijacking performance counters on core 3
WARN: Hijacking performance counters on core 4
WARN: Hijacking performance counters on core 5
WARN: Hijacking performance counters on core 6
WARN: Hijacking performance counters on core 7
WARN: Hijacking performance counters on core 8
WARN: Hijacking performance counters on core 9
WARN: Hijacking performance counters on core 10
WARN: Hijacking performance counters on core 11
WARN: Hijacking performance counters on core 12
WARN: Hijacking performance counters on core 13
WARN: Hijacking performance counters on core 14
WARN: Hijacking performance counters on core 15
WARN: Hijacking performance counters on core 16
WARN: Hijacking performance counters on core 17
WARN: Hijacking performance counters on core 18
WARN: Hijacking performance counters on core 19
TIME 2017-08-15 17:51:52
CORE IPC MISSES LLC[KB] MBL[MB/s] MBR[MB/s]
0 0.44 27k 0.0 0.0 0.0
1 0.73 0k 0.0 0.0 0.0
2 5.46 0k 0.0 0.0 0.0
3 5.46 0k 0.0 0.0 0.0
4 5.46 0k 0.0 0.0 0.0
5 2.77 2k 40.0 0.0 0.0
6 0.53 196k 560.0 0.0 0.0
7 1.35 238k 760.0 0.0 0.0
8 0.37 0k 0.0 0.0 0.0
9 0.37 0k 0.0 0.0 0.0
10 0.32 0k 0.0 0.0 0.0
11 0.38 0k 0.0 0.0 0.0
12 0.32 0k 0.0 0.0 0.0
13 0.32 0k 0.0 0.0 0.0
14 0.29 0k 0.0 0.0 0.0
15 0.26 0k 0.0 0.0 0.0
16 0.37 0k 0.0 0.0 0.0
17 0.37 0k 0.0 0.0 0.0
18 0.33 0k 0.0 0.0 0.0
19 0.34 0k 0.0 0.0 0.0
pqos -s
NOTE: Mixed use of MSR and kernel interfaces to manage
CAT or CMT & MBM may lead to unexpected behavior.
L3CA COS definitions for Socket 0:
L3CA COS0 => MASK 0xfffff
...
L3CA COS definitions for Socket 1:
L3CA COS0 => MASK 0xfffff
...123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172

可知当前系统支持CDP, L3 Cache 25M, way 大小 1310720 , 总计 20 ways.

L3 CAT details: CDP support=1, CDP on=0, #COS=16, #ways=20, ways contention bit-mask 0xc0000
INFO: L3 CAT details: cache size 26214400 bytes, way size 1310720 12

默认所有core使用所有的 L3 cache way

配置 L3 cache 分配策略(1使用4-way,2使用16-way)

pqos -e "llc:1=0x000f;llc:2=0xffff0;"1

配置 L3 cache 分配策略(1使用2-way,2使用14-way,3使用4-way)

pqos -e "llc:1=0x00003;llc:2=0xfffc0;llc:3=0x0003c"1

配置 CPU core L3 cache 分配策略

pqos -a "llc:1=0,21;llc:2=1-4,6-9,11-14,16-19;llc:3=5,10,15,20"

sudo pqos -e llc:1=0x0001
sudo pqos -a llc:1=0
sudo taskset -apc 0 $(pidof qemu-system-x86_64)
sudo pqos -e "llc:2=0x0ffe"
sudo pqos -a "llc:2=1-11"1234567

注意:
只有Intel v3部分 & v4 系列CPU支持 CDP. 此功能主要用于优化虚拟机 & DPDK 等应用场景,减少cache miss, 提高性能.

参考

INTEL® XEON® PROCESSOR E5 FAMILY
Intel® Xeon® Processor E5-2600 v4 Product Family
Intel Resource Director Technology
Introduction to Cache Allocation Technology in the Intel® Xeon® Processor E5 v4 Family
Usage Models for Cache Allocation Technology in the Intel® Xeon® Processor E5 v4 Family
Software Enabling for Cache Allocation Technology in the Intel® Xeon® Processor E5 v4 Family
Proof Points for Cache Allocation Technology in the Intel® Xeon® Processor E5 v4 Family
Proof Points: Memory Bandwidth Monitoring in the Intel® Xeon® Processor E5 v4 Family
Code and Data Prioritization - Introduction and Usage Models in the Intel® Xeon® Processor E5 v4 Family
Intel-CMT-CAT Usage Examples
Understanding NUMA for 3D isotropic Finite Difference (3DFD) wave equation code
Web Resources about Intel® Transactional Synchronization Extensions
Intel Platform Quality of Service and Cache Allocation Technology
http://kernel.ubuntu.com/~cking/stress-ng/
https://github.com/01org/intel-cmt-cat/wiki/Useful-links
https://software.intel.com/en-us/articles/intel-performance-counter-monitor
https://www.kernel.org/doc/Documentation/x86/intel_rdt_ui.txt
https://software.intel.com/en-us/search/site/language/en?query=Cache+Allocation+Technology+in+the+Intel%C2%AE+Xeon%C2%AE+Processor+E5+v4+Family
http://danluu.com/intel-cat/
https://software.intel.com/en-us/articles/intel-xeon-processor-e5-2600-v4-product-family-technical-overview

https://www.intel.com/content/dam/www/public/us/en/documents/white-papers/increasing-platform-determinism-pqos-dpdk-paper.pdf
————————————————
版权声明:本文为CSDN博主「功名半纸」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/force_eagle/article/details/77197833

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 217,185评论 6 503
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 92,652评论 3 393
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 163,524评论 0 353
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 58,339评论 1 293
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 67,387评论 6 391
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 51,287评论 1 301
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 40,130评论 3 418
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 38,985评论 0 275
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 45,420评论 1 313
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,617评论 3 334
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,779评论 1 348
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,477评论 5 345
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 41,088评论 3 328
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,716评论 0 22
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,857评论 1 269
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 47,876评论 2 370
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,700评论 2 354