The Gateway to Computer Science Excellence
0 votes
To use cache memory, main memory is divided into cache lines, typically $32$ or $64$ bytes long. An entire cache line is cached at once. What is the advantage of caching an entire line instead of a single byte or word at a time?
in Operating System by Veteran (60.8k points)
recategorized by | 42 views

2 Answers

0 votes
An entire blocks of data (cache line )is copied from memory to the cache because the principle of locality tells us that once a byte is accessed, it is very likely that a nearby data will be needed soon.

principal of locality of reference does not always hold..But USUALLY holds.

So, By taking the complete contiguous address as a cache block ,reduce the chance for Cache miss.. directly improve the CPU performance.
by (433 points)
0 votes

Answer: An entire cache line is cached at once just to take advantage of the locality of reference since the memory access posses the principle of locality of reference. The locality of reference says if memory is accessed then the probability of accessing the nearby locations again is very high. So, by caching a complete cache line the probability of cache hit is increased.

by Boss (19.4k points)

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,834 questions
57,824 answers
108,308 users