看板 Grad-ProbAsk 關於我們 聯絡資訊
104台大資工OS第七題(2): Why having processor affinity is good to process in using data or instruction cache? 實在想不明白背後原因,麻煩大家了 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.112.25.105 ※ 文章網址: https://www.ptt.cc/bbs/Grad-ProbAsk/M.1482507060.A.540.html
yupog2003: 每個processor有自己的cache的話,有processor afinity 12/23 23:37
gary19941208: 因為每個processor有自己的cache,如果工作平分到每 12/23 23:38
gary19941208: 個processor,cache比較容易要更新,如果有affinity 12/23 23:38
gary19941208: ,比較不會cache miss 12/23 23:38
yupog2003: 可以避免一直將資料從某個processor的cache搬到另外一 12/23 23:38
yupog2003: 個processor的cache? 12/23 23:38
Transfat: 其實我有點沒搞清楚data cache和instruction cache, 所 12/23 23:46
Transfat: 以在這題目說data cahce 也算是processor有自己cache的 12/23 23:46
Transfat: 意思? 12/23 23:46
darren0831: http://imgur.com/lYRZ6h5 12/24 10:24
darren0831: 以上是我的想法 請指教 12/24 10:25
Transfat: 我瞭解了Darren, 感謝你>< 12/24 12:26
aa06697: cache coherence不是在指這個唷@@ 12/24 13:14
Transfat: Cache coherency 是專指在同一個processor運作下遇到的 12/24 13:21
Transfat: 狀況, 嗎? 12/24 13:21
darren0831: 你可以查查白算盤原文書喔 12/24 14:04
darren0831: cache coherence是指多重處理器中資料一致性的問題 12/24 14:07
darren0831: ,我是覺得有關啦 12/24 14:07
darren0831: processor affinity要有的最大原因就是要避免CPU CA 12/24 14:11
darren0831: CHE內容需要invalidating 跟repopulation,想請教a 12/24 14:11
darren0831: 大我哪裡說的不妥Orz 12/24 14:11
darren0831: http://imgur.com/p9aHF3K 12/24 14:25
Transfat: 太久沒念OS了.. 我來查查看 12/24 14:34
yupog2003: cache coherence好像是在說不相關的資料放在同一個 12/24 18:21
yupog2003: 阿不對,這是false sharing 12/24 18:23
yupog2003: 張凡書給的定義:multiprocessor經常需要將許多份相同 12/24 18:24
yupog2003: 備份的資料放在不同的cache中,而每個processor都可以 12/24 18:24
yupog2003: 對此備份做存取,因此multiprocessor會面臨這個問題 12/24 18:25
yupog2003: 感覺也是可以拿來解釋processor afinity,因為如果有 12/24 18:29
yupog2003: processor afinity就可以減少同一份cache出現在不同 12/24 18:29
yupog2003: processor的cache的機率了 12/24 18:30
ssssIssss: Processor Affinity:大部份對稱式多元處理系統(SMP)련 01/15 22:08
ssssIssss: SMP)試著避免行程由一個 處理器轉移到另一個處理 01/15 22:09
ssssIssss: ,在同一處理器上保持一個行程,這就是處理器親和性 01/15 22:09
ssssIssss: 而大多數SMP system都避免process從一個processor搬到 01/15 22:10
ssssIssss: 另一個processor上,若搬動的話則要flush掉原本CPU的ca 01/15 22:11
ssssIssss: che內容,reload資料到新CPU的cache,flush和reload成 01/15 22:12
ssssIssss: 本高應要避免 01/15 22:12
DLHZ: 簡言之 coherence是解決同步問題 affinity是提升效能的方法 12/21 20:07