'캐쉬'에 해당되는 글 1건

Cache write policies :: 2009/12/10 23:27

Cache의 쓰기 정책 정리.
Cache Write Policies and Performance 정리.
위 논문에서는 directed-mapped cache를 기본으로 가정한다.

Write-hit policies: What happens when there is a write hit.

  • Write-through (also called store-through). Write to main memory whenever a write is performed to the cache.
  • Write-back (also called store-in or copy-back). Write to main memory only when a block is purged from the cache.

Write-miss policies:
What happens when there is a write miss. These policies can be characterized by three semi-dependent parameters.
  • Write-allocate vs. no-write-allocate. If a write misses, do/do not allocate a line in the cache for the data written.
  • Fetch-on-write vs. no-fetch-on-write. A write that misses in the cache causes/does not cause the block to be fetched from a lower level in the memory hierarchy.
  • Write-before-hit vs. no-write-before-hit. Data is written into the cache before/only after checking the tags to make sure they match. Hence a write-before-hit policy will displace a block already there in case of a miss.

Miss-policy는 3가지가 othogonal하게 적용이 가능하다. 하지만, no-write-allocate와 fetch-on-write 조합의 경우 쓸데없이 가져오기만 하므로 별 효용이 없으므로 제한다.  Write-allocate을 한다고 하면, 항상 그 cache라인에 써야 하기 때문에 Write-before-hit를 적용 하던지 안 하던지 결과는 같다. 하지만 Write-allocate을 적용 안 한다면 write-before-hit을 적용할 경우 원래 있는 정상적인 cache line의 데이터를 더럽힐 수 있으므로 이 경우 그 cache line을 invalidate해 주어야 한다. 이것을 표로 나타내면 다음과 같다.
사용자 삽입 이미지


하지만, 본 논문에서의 가정은 directed-mapped cache를 가정하고 있다. 이것은 잘 사용되지 않으므로 set-associative를 가정하는 것이 더 설득력 있다. Set-associative cache를 가정한다면 여러 Write-before-hit을 사용하는 것은 사실상 불가능하다. (왜냐하면 여러 cache line중에 어디에 쓸지 결정을 할 수가 없기 때문에...) 그러므로 write-before-hit을 제외하면 경우의 수는 다음과 같다.
사용자 삽입 이미지

따라서 Write-miss policy는 상기 3가지에 대해서만 고려하면 될 것 같다.

References:
1. Lecture Notes from North Carolina State University
2. Jouppi, N.P., "Cache Write Policies And Performance," Computer Architecture, 1993., Proceedings of the 20th Annual International Symposium on , vol., no., pp.191-201, 16-19 May 1993

2009/12/10 23:27 2009/12/10 23:27
Trackback Address :: http://insidexino.net/trackback/2757344