Information Technology Reference
In-Depth Information
with each buffer cache entry to, for example, prevent one process from reading
a block while another process writes it or to ensure that a given block is only
fetched from the storage device once, even if it is simultaneously read by many
processes.
Prefetching. Operating systems use prefetching to improve I/O performance.
For example, if a process reads the first two blocks of a file, the operating system
may prefetch the next ten blocks.
Such prefetching can have several beneficial effects:
Reduced latency. When predictions are accurate, prefetching can help
the latency of future requests because reads can be serviced from main
memory rather than from slower storage devices.
Reduced device overhead. Prefetching can help reduce storage device
overheads by replacing a large number of small requests with one large
one.
Improved parallelism. Some storage devices such as Redundant Arrays
of Inexpensive Disks (RAIDs) and Flash drives are able to process multiple
requests at once, in parallel. Prefetching provides a way for operating
systems to take advantage of available hardware parallelism.
Prefetching, however, must be used with care.
Too-aggressive prefetching
can cause problems:
Cache pressure. Each prefetched block is stored in the block cache,
and it may displace another block from the cache. If the evicted block
is needed before the prefetched one is used, prefetching is likely to hurt
overall performance.
I/O contention. Prefetch requests consume I/O resources. If other re-
quests have to wait behind prefetch requests, prefetching may hurt overall
performance.
Wasted effort. Operating system prefetching is speculative. If the
prefetched blocks end up being needed, then prefetching can help perfor-
mance; otherwise, prefetching may hurt overall performance by wasting
memory space, I/O device bandwidth, and CPU cycles.
11.3.2
Device drivers: Common abstractions
Device drivers translate between the high level abstractions implemented by the
Definition: device driver
operating system and the hardware-specific details of I/O devices.
Search WWH ::




Custom Search