토픽 37 / 111·메모리 계층 (Memory Hierarchy)
캐시 쓰기 정책 (Write-Through vs Write-Back)
캐시 쓰기 정책 (Write-Through vs Write-Back)
캐시 쓰기 시 메모리에 언제 반영할지 결정하는 정책
특징: 일관성과 성능의 트레이드오프, Write Allocate 정책과 조합
Write-Through: 캐시+메모리 동시 쓰기, 항상 일치, 단순, 느림(매 쓰기 메모리 접근), Write Buffer로 완화
Write-Back: 캐시에만 쓰기+Dirty Bit, 교체 시 메모리 반영, 빠름, 불일치 구간 존재
Write Allocate: Write Miss 시 캐시에 적재 후 쓰기, Write-Back과 조합
No-Write Allocate: Write Miss 시 메모리 직접 쓰기, Write-Through와 조합
일반적 조합: Write-Back + Write Allocate(현대 CPU 주류)
비교: Write-Through(즉시반영/일관성/느림/단순) vs Write-Back(지연반영/빠름/Dirty Bit/복잡)
적용사례: Intel/AMD CPU(Write-Back), GPU(Write-Through 또는 Write-Back)
연관: 캐시 메모리, 캐시 일관성(MESI), 메모리 배리어, Dirty Bit