→ yupog2003: 對於read from I/O來說,不管是write through或write01/02 22:27
→ yupog2003: back,DMA從IO讀資料進memory都不會改變cache中的資料01/02 22:28
→ yupog2003: CPU要讀資料的時候發現cache已經有他要的資料了,就不01/02 22:28
→ yupog2003: 會再去memory找,殊不知,memory中的資料才是從I/O讀進01/02 22:29
→ yupog2003: 來最新的資料,因此CPU總是拿到舊資料01/02 22:29
→ yupog2003: 對於write to I/O來說,採用write back會導致CPU寫入01/02 22:30
→ yupog2003: cache時不會立即更新memory中的資料,而DMA要寫資料到01/02 22:31
→ yupog2003: I/O只會從memory抓資料來寫入,如此一來,DMA就會抓到01/02 22:31
→ yupog2003: 舊資料了01/02 22:31
→ yupog2003: 但採用write through的話,CPU寫入cache時同時更新01/02 22:32
→ yupog2003: memory中的資料,因此DMA在抓資料來寫入I/O時,就會抓01/02 22:33
→ yupog2003: 到從CPU吐出來最新的資料,因此不會產生問題01/02 22:33
→ yupog2003: 感覺我只是把解答翻譯成中文然後口語化一點,不知道有01/02 22:35
→ yupog2003: 沒有幫助XD01/02 22:36
→ h9638512: 解釋的好清楚 非常感謝你!!01/02 22:38
這題是清大103計系第13題
想再請問一下
什麼是dma perform read
什麼是dma perform write
dma perform read是從io device讀資料進到memory嗎?
那dma perform write是什麼?
這題搞得我好亂啊...
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 42.72.77.91
※ 文章網址: https://www.ptt.cc/bbs/Grad-ProbAsk/M.1485776736.A.FC0.html
推 yupog2003: dma perform write應該就是從memory抓資料寫到io? 01/30 20:03
→ DLHZ: read: 讀mem 、write: 寫mem 01/07 00:22