SlideShare a Scribd company logo
1 of 27
Download to read offline
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

More Related Content

Similar to 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
 

Similar to 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
 

More from Kouji Matsui

More from 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をてなずけよう
 
式の体を成して無い式を式の体を成すように式と式木で何とかする式
式の体を成して無い式を式の体を成すように式と式木で何とかする式式の体を成して無い式を式の体を成すように式と式木で何とかする式
式の体を成して無い式を式の体を成すように式と式木で何とかする式
 

Recently uploaded

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
 

Recently uploaded (20)

The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
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
 
%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
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide Deck
 
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...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
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
 

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