Re: [理工] [計組] write back
※ 引述《mqazz1 (無法顯示)》之銘言:
: 張凡下冊290頁 題58
: (3) In today's computer systems, virtual memory and cache work together as a
: hierarchy. When the operating system decides to move a page back to disk,
: the contents of that page may have been brought into the cache already.
: What should the OS do with the contents that are in the cache?
: =====
: Force the related blocks to write back if they are dirty or invalid the
: related blocks if they are clean.
: 請問它的題目跟解答是在說什麼@@?
: 謝謝
意思是說
假如現在某個page在memory
在這個page的某段資料
並且被搬到Cache以後
現在想要把這page從memory移除 該如何做?
被搬到cache的某個line 它的valid bit=1
也就是說它是有效的 只把memory理page內容直接搬回disk 可能會有問題
搬回disk的資料跟留在cache的資料不一樣
A 如果這個cache line他沒有被修改過 dirty bit = 0
那麼直接把他的valid bit設成0
最後把page寫回disk
B 如果這個cache line被修改過 dirty bit = 1
表示現在page的某段資料跟cache line資料並不一樣
先把cache line的資料write back回memory 在把valid bit設成0
最後把這page寫回disk
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.34.83.238
推
08/25 01:39, , 1F
08/25 01:39, 1F
→
08/25 01:40, , 2F
08/25 01:40, 2F
→
08/25 01:41, , 3F
08/25 01:41, 3F
推
08/25 10:29, , 4F
08/25 10:29, 4F
→
08/25 12:11, , 5F
08/25 12:11, 5F
→
08/25 12:12, , 6F
08/25 12:12, 6F
→
08/25 12:12, , 7F
08/25 12:12, 7F
→
08/25 12:14, , 8F
08/25 12:14, 8F
推
08/25 22:22, , 9F
08/25 22:22, 9F
→
08/25 22:23, , 10F
08/25 22:23, 10F
→
09/11 14:29, , 11F
09/11 14:29, 11F
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 4 篇):