SlideShare une entreprise Scribd logo
1  sur  27
Télécharger pour lire hors ligne
Locality
of
Reference
2017.10.28 NAGOYA.BIN #1 KOUJI MATSUI (@KEKYO2)
Kouji Matsui - kekyo
• NAGOYA city, AICHI pref., JP
• Twitter – @kekyo2 / Facebook
• ux-spiral corporation
• Microsoft Most Valuable Professional VS
and DevTech 2015-
• Certified Scrum master / Scrum product
owner
• Center CLR organizer.
• .NET/C#/F#/IL/metaprogramming or like…
• Bike rider
Agenda
•Physical side scales
•Logical side scales
•Data stream between physicals and logicals
•Locality of reference
•Anti-locality of reference
•Conclusion
Physical side scales
Physical side scales
Processor #1
Physical Core #4
Logical Core #1Logical Core #1Logical Core #1Logical Core #1Physical Core #3
Logical Core #1Logical Core #1Logical Core #1Logical Core #1Physical Core #2
Logical Core #1Logical Core #1Logical Core #1Logical Core #1Physical Core #1
Logical Core #1Logical Core #1Logical Core #1Logical Core #1
Processor #2
Physical Core #8
Logical Core #1Logical Core #1Logical Core #1Logical Core #1Physical Core #7
Logical Core #1Logical Core #1Logical Core #1Logical Core #1Physical Core #6
Logical Core #1Logical Core #1Logical Core #1Logical Core #1Physical Core #5
Logical Core #1Logical Core #1Logical Core #1Logical Core #17
Processor #3
Physical Core #12
Logical Core #1Logical Core #1Logical Core #1Logical Core #1Physical Core #11
Logical Core #1Logical Core #1Logical Core #1Logical Core #1Physical Core #10
Logical Core #1Logical Core #1Logical Core #1Logical Core #1Physical Core #9
Logical Core #1Logical Core #1Logical Core #1Logical Core #33
Physical side scales
The memory/IO bind at
the fixed CPU/Core
(Non configurable)
Physical side scales
The “shared cache memory” bind at the fixed
CPU/Core
(Non configurable)
Physical side scales
The “cache memory” bind at the fixed CPU/Core
(Non configurable)
The “shared cache memory” bind at the fixed
CPU/Core
(Non configurable)
Agenda
•Physical side scales
•Logical side scales
•Data stream between physicals and logicals
•Locality of reference
•Anti-locality of reference
•Conclusion
Logical side scales
Process #1
Virtual
Memory
Space
Thread #1
Thread #1
Thread #1
Thread #1
Thread #1
Process #2
Virtual
Memory
Space
Thread #1
Thread #1
Thread #1
Thread #1
Thread #11
Process #3
Virtual
Memory
Space
Thread #1
Thread #1
Thread #1
Thread #1
Thread #21
Process #4
Virtual
Memory
Space
Thread #1
Thread #1
Thread #1
Thread #1
Thread #31
Process #5
Virtual
Memory
Space
Thread #1
Thread #1
Thread #1
Thread #1
Thread #41
Logical side scales
Thread #1
Thread #1
Thread #1
Thread #1
Thread #1
Thread #1
Thread #1
Thread #1
Thread #1
Thread #11
Thread #1
Thread #1
Thread #1
Thread #1
Thread #21
Thread #1
Thread #1
Thread #1
Thread #1
Thread #31
Thread #1
Thread #1
Thread #1
Thread #1
Thread #41
Logical Core #4
Logical Core #3
Logical Core #2
Logical Core #1
This is true story
Execution context
Logical side scales
Thread #1
Thread #1
Thread #1
Thread #1
Thread #1
Thread #1
Thread #1
Thread #1
Thread #1
Thread #11
Thread #1
Thread #1
Thread #1
Thread #1
Thread #21
Thread #1
Thread #1
Thread #1
Thread #1
Thread #31
Thread #1
Thread #1
Thread #1
Thread #1
Thread #41
Logical Core #4
Logical Core #3
Logical Core #2
Logical Core #1
Switch execution
context
Agenda
•Physical side scales
•Logical side scales
•Data stream between physicals and logicals
•Locality of reference
•Anti-locality of reference
•Conclusion
Data stream between physicals and logicals
Thread #1
Thread #1
Thread #1
Thread #1
Thread #1
Thread #1
Thread #1
Thread #1
Thread #1
Thread #11
Thread #1
Thread #1
Thread #1
Thread #1
Thread #21
Thread #1
Thread #1
Thread #1
Thread #1
Thread #31
Thread #1
Thread #1
Thread #1
Thread #1
Thread #41
Logical Core #4
Logical Core #3
Logical Core #2
Logical Core #1
L1/L2 cache #1
L1/L2 cache #2 L1/L2 cache #4
L1/L2 cache #3
Thread #1
Thread #1
Thread #1
Thread #1
Thread #1
Thread #1
Thread #1
Thread #1
Thread #1
Thread #11
Thread #1
Thread #1
Thread #1
Thread #1
Thread #21
Thread #1
Thread #1
Thread #1
Thread #1
Thread #31
Thread #1
Thread #1
Thread #1
Thread #1
Thread #41
Logical Core #4
Logical Core #3
Logical Core #2
Logical Core #1
L1/L2 cache #1
L1/L2 cache #2 L1/L2 cache #4
L3 cache #1 L3 cache #2
L1/L2 cache #3
Thread #1
Thread #1
Thread #1
Thread #1
Thread #1
Thread #1
Thread #1
Thread #1
Thread #1
Thread #11
Thread #1
Thread #1
Thread #1
Thread #1
Thread #21
Thread #1
Thread #1
Thread #1
Thread #1
Thread #31
Thread #1
Thread #1
Thread #1
Thread #1
Thread #41
Logical Core #4
Logical Core #3
Logical Core #2
Logical Core #1
L1/L2 cache #1
L1/L2 cache #2
L1/L2 cache #3
L1/L2 cache #4
L3 cache #1 L3 cache #2
NUMA node bound memory
Agenda
•Physical side scales
•Logical side scales
•Data stream between physicals and logicals
•Locality of reference
•Anti-locality of reference
•Conclusion
Thread #1
Thread #1
Thread #1
Thread #1
Thread #31
Thread #1
Thread #1
Thread #1
Thread #1
Thread #41
Logical Core #4
L1/L2 cache #4
L3 cache #2
NUMA node bound memory
declaredType
currentType
stopType
field
FieldInfo[]
Thread #33 context
Load/Preload
Thread #1
Thread #1
Thread #1
Thread #1
Thread #31
Thread #1
Thread #1
Thread #1
Thread #1
Thread #41
Logical Core #4
L1/L2 cache #4
L3 cache #2
NUMA node bound memory
__stack0_0
Thread #42 context
__stack0_1
__stack0_2
__stack1_0
declaredType
currentType
local0
local1
field
Load/Preload
Switch
Thread #1
Thread #1
Thread #1
Thread #1
Thread #21
Thread #1
Thread #1
Thread #1
Thread #1
Thread #31
Thread #1
Thread #1
Thread #1
Thread #1
Thread #41
Logical Core #4
Logical Core #3
L1/L2 cache #3
L1/L2 cache #4
L3 cache #2
NUMA node bound memory
declaredType
currentType
stopType
field
FieldInfo[]
Thread #1
Thread #1
Thread #1
Thread #1
Thread #21
Thread #1
Thread #1
Thread #1
Thread #1
Thread #31
Thread #1
Thread #1
Thread #1
Thread #1
Thread #41
Logical Core #4
Logical Core #3
L1/L2 cache #3
L1/L2 cache #4
L3 cache #2
NUMA node bound memory
declaredType
currentType
stopType
field
FieldInfo[]
stopType
field
FieldInfo[]
field
Load/Preload
Switch
Agenda
•Physical side scales
•Logical side scales
•Data stream between physicals and logicals
•Locality of reference
•Anti-locality of reference
•Conclusion
Thread #1
Thread #1
Thread #1
Thread #1
Thread #21
Thread #1
Thread #1
Thread #1
Thread #1
Thread #31
Thread #1
Thread #1
Thread #1
Thread #1
Thread #41
Logical Core #4
Logical Core #3
L1/L2 cache #3
L1/L2 cache #4
L3 cache #2
NUMA node bound memory
Common value
Common value
Common value
Load/Preload
Load/Preload
These threads access
common value
Thread #1
Thread #1
Thread #1
Thread #1
Thread #21
Thread #1
Thread #1
Thread #1
Thread #1
Thread #31
Thread #1
Thread #1
Thread #1
Thread #1
Thread #41
Logical Core #4
Logical Core #3
L1/L2 cache #3
L1/L2 cache #4
L3 cache #2
NUMA node bound memory
Common value
Common value
Common value
Race condition
(Receive coherence penalty)
STRATEGY:
• Turn to immutable
• Hashed indexer
Writeback
Writeback
Agenda
•Physical side scales
•Logical side scales
•Data stream between physicals and logicals
•Locality of reference
•Anti-locality of reference
•Conclusion
Conclusion
The execution context bounds not THREAD. The code executor is
CPU CORE.
CPU cores have structuable nested cache system.
Cache miss penalty is large.
Cache coherency penalty is large.
Both I/O systems too.
Important cache-related architecture:
◦ Locality of reference
◦ Immutable
Thanks join!
My blog
◦ http://www.kekyo.net/
Current active project:
◦ IL2C - A translator implementation of .NET intermediate language to C
language.
◦ YouTube: http://bit.ly/2xtu4MH
◦ GitHub: https://github.com/kekyo/IL2C

Contenu connexe

Similaire à Locality of Reference

Are Java Programmers Transitioning to Multicore?
Are Java Programmers Transitioning to Multicore? Are Java Programmers Transitioning to Multicore?
Are Java Programmers Transitioning to Multicore?
UFPA
 
The Road to Reproducible Computational Research
The Road to Reproducible Computational ResearchThe Road to Reproducible Computational Research
The Road to Reproducible Computational Research
Andrey Moskalenko
 

Similaire à Locality of Reference (20)

main memory
main memorymain memory
main memory
 
Bin carver
Bin carverBin carver
Bin carver
 
.NET Fest 2018. Денис Резник. Почему мой запрос тормозит и как это исправить
.NET Fest 2018. Денис Резник. Почему мой запрос тормозит и как это исправить.NET Fest 2018. Денис Резник. Почему мой запрос тормозит и как это исправить
.NET Fest 2018. Денис Резник. Почему мой запрос тормозит и как это исправить
 
50 Shades of Fail KScope16
50 Shades of Fail KScope1650 Shades of Fail KScope16
50 Shades of Fail KScope16
 
Approximate "Now" is Better Than Accurate "Later"
Approximate "Now" is Better Than Accurate "Later"Approximate "Now" is Better Than Accurate "Later"
Approximate "Now" is Better Than Accurate "Later"
 
Игорь Фесенко "Direction of C# as a High-Performance Language"
Игорь Фесенко "Direction of C# as a High-Performance Language"Игорь Фесенко "Direction of C# as a High-Performance Language"
Игорь Фесенко "Direction of C# as a High-Performance Language"
 
Trouble-shooting Tips for Primo (2013)
Trouble-shooting Tips for Primo (2013)Trouble-shooting Tips for Primo (2013)
Trouble-shooting Tips for Primo (2013)
 
Are Java Programmers Transitioning to Multicore?
Are Java Programmers Transitioning to Multicore? Are Java Programmers Transitioning to Multicore?
Are Java Programmers Transitioning to Multicore?
 
Cassandra introduction mars jug
Cassandra introduction mars jugCassandra introduction mars jug
Cassandra introduction mars jug
 
Kernel Recipes 2015: Solving the Linux storage scalability bottlenecks
Kernel Recipes 2015: Solving the Linux storage scalability bottlenecksKernel Recipes 2015: Solving the Linux storage scalability bottlenecks
Kernel Recipes 2015: Solving the Linux storage scalability bottlenecks
 
Elixir@SFI
Elixir@SFIElixir@SFI
Elixir@SFI
 
.NET Memory Primer (Martin Kulov)
.NET Memory Primer (Martin Kulov).NET Memory Primer (Martin Kulov)
.NET Memory Primer (Martin Kulov)
 
The Road to Reproducible Computational Research
The Road to Reproducible Computational ResearchThe Road to Reproducible Computational Research
The Road to Reproducible Computational Research
 
Java 8 -12: da Oracle a Eclipse. Due anni e una rivoluzione
Java 8 -12: da Oracle a Eclipse. Due anni e una rivoluzioneJava 8 -12: da Oracle a Eclipse. Due anni e una rivoluzione
Java 8 -12: da Oracle a Eclipse. Due anni e una rivoluzione
 
The Pill for Your Migration Hell
The Pill for Your Migration HellThe Pill for Your Migration Hell
The Pill for Your Migration Hell
 
Deep Dive into Spark
Deep Dive into SparkDeep Dive into Spark
Deep Dive into Spark
 
It5304 syllabus
It5304 syllabusIt5304 syllabus
It5304 syllabus
 
.NET Fest 2019. Денис Резник. Когда SQL Server Best Practices не работают
.NET Fest 2019. Денис Резник. Когда SQL Server Best Practices не работают.NET Fest 2019. Денис Резник. Когда SQL Server Best Practices не работают
.NET Fest 2019. Денис Резник. Когда SQL Server Best Practices не работают
 
COBOL to Apache Spark
COBOL to Apache SparkCOBOL to Apache Spark
COBOL to Apache Spark
 
Conceptos básicos. Seminario web 1: Introducción a NoSQL
Conceptos básicos. Seminario web 1: Introducción a NoSQLConceptos básicos. Seminario web 1: Introducción a NoSQL
Conceptos básicos. Seminario web 1: Introducción a NoSQL
 

Plus de Kouji Matsui

Plus de Kouji Matsui (20)

パターンでわかる! .NET Coreの非同期処理
パターンでわかる! .NET Coreの非同期処理パターンでわかる! .NET Coreの非同期処理
パターンでわかる! .NET Coreの非同期処理
 
Making archive IL2C #6-55 dotnet600 2018
Making archive IL2C #6-55 dotnet600 2018Making archive IL2C #6-55 dotnet600 2018
Making archive IL2C #6-55 dotnet600 2018
 
Matrix signal controller and BrainPad overview
Matrix signal controller and BrainPad overviewMatrix signal controller and BrainPad overview
Matrix signal controller and BrainPad overview
 
Fun with BrainPad
Fun with BrainPadFun with BrainPad
Fun with BrainPad
 
What's Functional?
What's Functional?What's Functional?
What's Functional?
 
Pitfall for WioLTE
Pitfall for WioLTEPitfall for WioLTE
Pitfall for WioLTE
 
How to make the calculator
How to make the calculatorHow to make the calculator
How to make the calculator
 
Write common, run anywhere
Write common, run anywhereWrite common, run anywhere
Write common, run anywhere
 
Nespのコード生成
Nespのコード生成Nespのコード生成
Nespのコード生成
 
You will be assimilated. Resistance is futile.
You will be assimilated. Resistance is futile.You will be assimilated. Resistance is futile.
You will be assimilated. Resistance is futile.
 
How to meets Async and Task
How to meets Async and TaskHow to meets Async and Task
How to meets Async and Task
 
Beachhead implements new opcode on CLR JIT
Beachhead implements new opcode on CLR JITBeachhead implements new opcode on CLR JIT
Beachhead implements new opcode on CLR JIT
 
Async deepdive before de:code
Async deepdive before de:codeAsync deepdive before de:code
Async deepdive before de:code
 
Thread affinity and CPS
Thread affinity and CPSThread affinity and CPS
Thread affinity and CPS
 
Async DeepDive basics
Async DeepDive basicsAsync DeepDive basics
Async DeepDive basics
 
continuatioN Linking
continuatioN LinkingcontinuatioN Linking
continuatioN Linking
 
真Intermediate languageのキホン
真Intermediate languageのキホン真Intermediate languageのキホン
真Intermediate languageのキホン
 
.NET Coreから概観する.NETのOSSへの取り組み
.NET Coreから概観する.NETのOSSへの取り組み.NET Coreから概観する.NETのOSSへの取り組み
.NET Coreから概観する.NETのOSSへの取り組み
 
Win32 APIをてなずけよう
Win32 APIをてなずけようWin32 APIをてなずけよう
Win32 APIをてなずけよう
 
式の体を成して無い式を式の体を成すように式と式木で何とかする式
式の体を成して無い式を式の体を成すように式と式木で何とかする式式の体を成して無い式を式の体を成すように式と式木で何とかする式
式の体を成して無い式を式の体を成すように式と式木で何とかする式
 

Dernier

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 

Dernier (20)

Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 

Locality of Reference

  • 2. Kouji Matsui - kekyo • NAGOYA city, AICHI pref., JP • Twitter – @kekyo2 / Facebook • ux-spiral corporation • Microsoft Most Valuable Professional VS and DevTech 2015- • Certified Scrum master / Scrum product owner • Center CLR organizer. • .NET/C#/F#/IL/metaprogramming or like… • Bike rider
  • 3. Agenda •Physical side scales •Logical side scales •Data stream between physicals and logicals •Locality of reference •Anti-locality of reference •Conclusion
  • 5. Physical side scales Processor #1 Physical Core #4 Logical Core #1Logical Core #1Logical Core #1Logical Core #1Physical Core #3 Logical Core #1Logical Core #1Logical Core #1Logical Core #1Physical Core #2 Logical Core #1Logical Core #1Logical Core #1Logical Core #1Physical Core #1 Logical Core #1Logical Core #1Logical Core #1Logical Core #1 Processor #2 Physical Core #8 Logical Core #1Logical Core #1Logical Core #1Logical Core #1Physical Core #7 Logical Core #1Logical Core #1Logical Core #1Logical Core #1Physical Core #6 Logical Core #1Logical Core #1Logical Core #1Logical Core #1Physical Core #5 Logical Core #1Logical Core #1Logical Core #1Logical Core #17 Processor #3 Physical Core #12 Logical Core #1Logical Core #1Logical Core #1Logical Core #1Physical Core #11 Logical Core #1Logical Core #1Logical Core #1Logical Core #1Physical Core #10 Logical Core #1Logical Core #1Logical Core #1Logical Core #1Physical Core #9 Logical Core #1Logical Core #1Logical Core #1Logical Core #33
  • 6. Physical side scales The memory/IO bind at the fixed CPU/Core (Non configurable)
  • 7. Physical side scales The “shared cache memory” bind at the fixed CPU/Core (Non configurable)
  • 8. Physical side scales The “cache memory” bind at the fixed CPU/Core (Non configurable) The “shared cache memory” bind at the fixed CPU/Core (Non configurable)
  • 9. Agenda •Physical side scales •Logical side scales •Data stream between physicals and logicals •Locality of reference •Anti-locality of reference •Conclusion
  • 10. Logical side scales Process #1 Virtual Memory Space Thread #1 Thread #1 Thread #1 Thread #1 Thread #1 Process #2 Virtual Memory Space Thread #1 Thread #1 Thread #1 Thread #1 Thread #11 Process #3 Virtual Memory Space Thread #1 Thread #1 Thread #1 Thread #1 Thread #21 Process #4 Virtual Memory Space Thread #1 Thread #1 Thread #1 Thread #1 Thread #31 Process #5 Virtual Memory Space Thread #1 Thread #1 Thread #1 Thread #1 Thread #41
  • 11. Logical side scales Thread #1 Thread #1 Thread #1 Thread #1 Thread #1 Thread #1 Thread #1 Thread #1 Thread #1 Thread #11 Thread #1 Thread #1 Thread #1 Thread #1 Thread #21 Thread #1 Thread #1 Thread #1 Thread #1 Thread #31 Thread #1 Thread #1 Thread #1 Thread #1 Thread #41 Logical Core #4 Logical Core #3 Logical Core #2 Logical Core #1 This is true story Execution context
  • 12. Logical side scales Thread #1 Thread #1 Thread #1 Thread #1 Thread #1 Thread #1 Thread #1 Thread #1 Thread #1 Thread #11 Thread #1 Thread #1 Thread #1 Thread #1 Thread #21 Thread #1 Thread #1 Thread #1 Thread #1 Thread #31 Thread #1 Thread #1 Thread #1 Thread #1 Thread #41 Logical Core #4 Logical Core #3 Logical Core #2 Logical Core #1 Switch execution context
  • 13. Agenda •Physical side scales •Logical side scales •Data stream between physicals and logicals •Locality of reference •Anti-locality of reference •Conclusion
  • 14. Data stream between physicals and logicals Thread #1 Thread #1 Thread #1 Thread #1 Thread #1 Thread #1 Thread #1 Thread #1 Thread #1 Thread #11 Thread #1 Thread #1 Thread #1 Thread #1 Thread #21 Thread #1 Thread #1 Thread #1 Thread #1 Thread #31 Thread #1 Thread #1 Thread #1 Thread #1 Thread #41 Logical Core #4 Logical Core #3 Logical Core #2 Logical Core #1 L1/L2 cache #1 L1/L2 cache #2 L1/L2 cache #4 L1/L2 cache #3
  • 15. Thread #1 Thread #1 Thread #1 Thread #1 Thread #1 Thread #1 Thread #1 Thread #1 Thread #1 Thread #11 Thread #1 Thread #1 Thread #1 Thread #1 Thread #21 Thread #1 Thread #1 Thread #1 Thread #1 Thread #31 Thread #1 Thread #1 Thread #1 Thread #1 Thread #41 Logical Core #4 Logical Core #3 Logical Core #2 Logical Core #1 L1/L2 cache #1 L1/L2 cache #2 L1/L2 cache #4 L3 cache #1 L3 cache #2 L1/L2 cache #3
  • 16. Thread #1 Thread #1 Thread #1 Thread #1 Thread #1 Thread #1 Thread #1 Thread #1 Thread #1 Thread #11 Thread #1 Thread #1 Thread #1 Thread #1 Thread #21 Thread #1 Thread #1 Thread #1 Thread #1 Thread #31 Thread #1 Thread #1 Thread #1 Thread #1 Thread #41 Logical Core #4 Logical Core #3 Logical Core #2 Logical Core #1 L1/L2 cache #1 L1/L2 cache #2 L1/L2 cache #3 L1/L2 cache #4 L3 cache #1 L3 cache #2 NUMA node bound memory
  • 17. Agenda •Physical side scales •Logical side scales •Data stream between physicals and logicals •Locality of reference •Anti-locality of reference •Conclusion
  • 18. Thread #1 Thread #1 Thread #1 Thread #1 Thread #31 Thread #1 Thread #1 Thread #1 Thread #1 Thread #41 Logical Core #4 L1/L2 cache #4 L3 cache #2 NUMA node bound memory declaredType currentType stopType field FieldInfo[] Thread #33 context Load/Preload
  • 19. Thread #1 Thread #1 Thread #1 Thread #1 Thread #31 Thread #1 Thread #1 Thread #1 Thread #1 Thread #41 Logical Core #4 L1/L2 cache #4 L3 cache #2 NUMA node bound memory __stack0_0 Thread #42 context __stack0_1 __stack0_2 __stack1_0 declaredType currentType local0 local1 field Load/Preload Switch
  • 20. Thread #1 Thread #1 Thread #1 Thread #1 Thread #21 Thread #1 Thread #1 Thread #1 Thread #1 Thread #31 Thread #1 Thread #1 Thread #1 Thread #1 Thread #41 Logical Core #4 Logical Core #3 L1/L2 cache #3 L1/L2 cache #4 L3 cache #2 NUMA node bound memory declaredType currentType stopType field FieldInfo[]
  • 21. Thread #1 Thread #1 Thread #1 Thread #1 Thread #21 Thread #1 Thread #1 Thread #1 Thread #1 Thread #31 Thread #1 Thread #1 Thread #1 Thread #1 Thread #41 Logical Core #4 Logical Core #3 L1/L2 cache #3 L1/L2 cache #4 L3 cache #2 NUMA node bound memory declaredType currentType stopType field FieldInfo[] stopType field FieldInfo[] field Load/Preload Switch
  • 22. Agenda •Physical side scales •Logical side scales •Data stream between physicals and logicals •Locality of reference •Anti-locality of reference •Conclusion
  • 23. Thread #1 Thread #1 Thread #1 Thread #1 Thread #21 Thread #1 Thread #1 Thread #1 Thread #1 Thread #31 Thread #1 Thread #1 Thread #1 Thread #1 Thread #41 Logical Core #4 Logical Core #3 L1/L2 cache #3 L1/L2 cache #4 L3 cache #2 NUMA node bound memory Common value Common value Common value Load/Preload Load/Preload These threads access common value
  • 24. Thread #1 Thread #1 Thread #1 Thread #1 Thread #21 Thread #1 Thread #1 Thread #1 Thread #1 Thread #31 Thread #1 Thread #1 Thread #1 Thread #1 Thread #41 Logical Core #4 Logical Core #3 L1/L2 cache #3 L1/L2 cache #4 L3 cache #2 NUMA node bound memory Common value Common value Common value Race condition (Receive coherence penalty) STRATEGY: • Turn to immutable • Hashed indexer Writeback Writeback
  • 25. Agenda •Physical side scales •Logical side scales •Data stream between physicals and logicals •Locality of reference •Anti-locality of reference •Conclusion
  • 26. Conclusion The execution context bounds not THREAD. The code executor is CPU CORE. CPU cores have structuable nested cache system. Cache miss penalty is large. Cache coherency penalty is large. Both I/O systems too. Important cache-related architecture: ◦ Locality of reference ◦ Immutable
  • 27. Thanks join! My blog ◦ http://www.kekyo.net/ Current active project: ◦ IL2C - A translator implementation of .NET intermediate language to C language. ◦ YouTube: http://bit.ly/2xtu4MH ◦ GitHub: https://github.com/kekyo/IL2C