〈每位程式開發者都該有的記憶體知識〉翻自 Ulrich Drepper 於 2007 年撰寫的論文〈What Every Programmer Should Know About Memory〉(版次: 1.0),儘管目前已涵蓋第一到第七章,然而仍有大量的改進要進行,如下:
研讀以下素材,在自己的電腦重現第 6 章的實驗並校訂相關描述。
過程中應在 GitHub 提交修訂的 pull request 並與授課教師協作。
實驗內容更新在本頁
在自己的電腦重現第 7 章的實驗並校訂相關描述。
過程中應在 GitHub 提交修訂的 pull request 並與授課教師協作。
實驗內容更新在本頁
對照原文和譯文,比對第 1 到第 5 章落差並校訂。過程中應在 GitHub 提交修訂的 pull request 並與授課教師協作。
2.2.3. 再充電註解:
譯文:不管 [3] 與其它文獻怎麼說,列都是這項操作的對象(見 [18])。
原文:Rows are the granularity this happens with despite what [3] and other literature says (see [18])
2.2.4. 記憶體類型 SDR SDRAM
譯文:由於大量的陣列單元,成本貴得嚇人。
原文: With a huge number of array cells this is prohibitively expensive
2.2.4. 記憶體類型 DDR3 之一:
譯文:這導致只在頻率高於 DDR2 所能達到的情況,並且 ── 儘管如此 ── 一般在頻寬比延遲時間更為重要的時候,DDR3 才有其用處。
原文: This would cause DDR3 to be useful only at frequencies which are higher than those which can be achieved with DDR2, and, even then, mostly when bandwidth is more important than latency.
2.2.4. 記憶體類型 DDR3 之二:
譯文:無論如何,由於更快的匯流排,達到更高速度的可能性將會超過增加的等待時間。
原文:In any case, the possibility of achieving higher speeds because of faster buses will outweigh the increased latency.
2.2.4. 記憶體類型序列匯流排缺點:
譯文:第二個問題是,晶片驅動序列匯流排需要大量的能量,因為頻率非常高、以及驅動匯流排的需求。
原文:A second problem is that the chip driving the serial bus requires significant amounts of energy because of the very high frequency and the need to drive a bus.
Pull Request for 1345
其中第三項沒有被採用
水平發展 > 垂直發展
Red Hat 未來產品 ( 2007 為基準 )
HT:超執行緒(Hyper-Threading),在 CPU 內僅複製必要資源,讓兩個執行緒可以在一單位時間內同時執行,就好像真的有實體雙核心,能進行雙執行緒運作 參考網站
現況如何?Image Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
2021 年發布 Power10
核心:15 SMT8 cores、30 SMT4 cores
其中 SMT = Simultaneous multithreading 同步多執行緒
個人電腦、小型伺服器 -標準化-> 晶片組(chipset)
Image Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
處理器設計趨勢:將更多功能集成到更少的組件上,降低總體主板成本並提高性能北橋消失:
Intel Nehalem 系列 CPU 將北橋的記憶體控制器整合進處理器,其餘北橋功能和南橋晶片整合
AMD 處理器整合北橋現代的處理器和主機板設計已經將許多北橋和南橋的功能整合到單一晶片中 -> 單晶片系統(System on a Chip, SoC):將電腦或其他電子系統整合到單一晶片的積體電路
Intel超低壓CPU、Intel Xeon D等Intel CPU已經內建南橋,AMD Ryzen、EPYC也內建了部分南橋功能
2.1 2.2 以邏輯閘(gate)層級討論硬體細節
讀取記憶單元的狀態:
寫到記憶單元:
問題:
優點:
但為何論文是寫 DDR DRAM 不直接寫 SDRAMImage Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
需釐清是否過時,或是現況如何(速度、頻率)Image Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
w | x | y | z | T |
---|---|---|---|---|
等待時間 | 至 等待時間 | 預充電 | 有效化至預充電延遲 | 命令速率 |
"for example" 的簡稱是 "e.g.",不是 "ex",不要誤用。
收到
註解:Image Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
譯文:不管 [3] 與其它文獻怎麼說,列都是這項操作的對象(見 [18])。 ↩
原文:Rows are the granularity this happens with despite what [3] and other literature says (see [18]).
granularity:顆粒度 -> 系統被劃分為碎片後那些碎片的大小
此句話要表達,列是重新充電的 "單位"
還沒想很清楚Image Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
SDR(單倍資料傳輸速率)SDRAM
Image Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
譯文:由於大量的陣列單元,成本貴得嚇人。
原文: With a huge number of array cells this is prohibitively expensive
-> 由於使用大量的陣列單元,代價高得嚇人。
DDR1(DDR) SDRAM
命名
Image Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
DDR2 SDRAM
DDR3(非用於顯卡中的假 GDDR3)
現在呢?Image Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Image Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
譯文:「這導致只在頻率高於 DDR2 所能達到的情況,並且 ── 儘管如此 ── 一般在頻寬比延遲時間更為重要的時候,DDR3 才有其用處。」
原文: This would cause DDR3 to be useful only at frequencies which are higher than those which can be achieved with DDR2, and, even then, mostly when bandwidth is more important than latency.
-> 這會導致 DDR3 只有在頻率高於 DDR2 能達到的頻率時才有用,且更甚的是通常只有在頻寬比延遲更加重要的時候才有用。
Image Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
譯文:「無論如何,由於更快的匯流排,達到更高速度的可能性將會超過增加的等待時間。」
原文:In any case, the possibility of achieving higher speeds because of faster buses will outweigh the increased latency.
-> 無論如何,因更快的匯流排而達到更高速度的可能性將會比增加的延遲"更重要"
為何有這個要求?Image Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
現在被剔除了嗎Image Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
所有 DDR 的問題:
補充菊花鏈結Image Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
解決辦法
達成了嗎?Image Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
NUMA 架構?Image Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
現在呢?Image Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
生產相對便宜:使用與現今 DDR2 模組相同的記憶體晶片
差異在連結到記憶體控制器的連線中
差動Image Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
一個 FB-DRAM 模組只有 69 根針腳
能較為妥善地處理匯流排的電氣影響
電氣影響Image Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
FB-DRAM 規範允許每通道至多 8 個 DRAM 模組
一個 FB-DRAM 控制器能夠同時連接多達六個通道
這裡的 6 個跟前面的 8 個?Image Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
有四個模組的 DDR2 系統擁有兩個通道 = 一個普通的 FB-DRAM 控制器,經由四個通道來達成
序列匯流排的實際頻寬取決於用在 FB-DRAM 模組的 DDR2(或 DDR3) 晶片類型
優點:
DDR2 | FB-DRAM | |
---|---|---|
針腳數 | 240 | 69 |
通道數 | 2 | 6 |
DIMM 數/通道數 | 2 | 8 |
最大記憶體(4GB) | 16GB | 192GB |
吞吐量(DDR2-800) | ~10GB/s | ~40GB/s |
缺點:
Image Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
譯文:「第二個問題是,晶片驅動序列匯流排需要大量的能量,因為頻率非常高、以及驅動匯流排的需求。」
原文:A second problem is that the chip driving the serial bus requires significant amounts of energy because of the very high frequency and the need to drive a bus.
-> 第二個問題是,由於非常高的頻率和驅動匯流排的需求,晶片驅動序列匯流排需要大量的能量
但有著同樣頻率、同樣記憶體容量的 FB-DRAM 總是比 DDR2 與 DDR3 還快
對於大型記憶體系統,DDR 完全沒有任何使用商用元件的解決方法
怎算Image Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
除了 CPU 之外,還有其它能夠存取主記憶體的系統元件
有些廉價系統的圖形系統缺乏獨立且專用的視訊 RAM(video RAM)
視訊 RAMImage Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported