Hardware Reference
In-Depth Information
lelism. SPECWeb also relies on request-level parallelism to use many processors while TPC-C
uses thread-level parallelism for faster processing of database queries.
At the level of an individual processor, taking advantage of parallelism among instructions
is critical to achieving high performance. One of the simplest ways to do this is through
pipelining. (It is explained in more detail in Appendix C and is a major focus of Chapter
3 . ) The basic idea behind pipelining is to overlap instruction execution to reduce the total
time to complete an instruction sequence. A key insight that allows pipelining to work is
that not every instruction depends on its immediate predecessor, so executing the instructions
completely or partially in parallel may be possible. Pipelining is the best-known example of
instruction-level parallelism.
Parallelism can also be exploited at the level of detailed digital design. For example, set-as-
sociative caches use multiple banks of memory that are typically searched in parallel to ind
a desired item. Modern ALUs (arithmetic-logical units) use carry-lookahead, which uses par-
allelism to speed the process of computing sums from linear to logarithmic in the number of
bits per operand. These are more examples of data-level parallelism.
Principle Of Locality
Important fundamental observations have come from properties of programs. The most im-
portant program property that we regularly exploit is the principle of locality : Programs tend
to reuse data and instructions they have used recently. A widely held rule of thumb is that a
program spends 90% of its execution time in only 10% of the code. An implication of locality
is that we can predict with reasonable accuracy what instructions and data a program will use
in the near future based on its accesses in the recent past. The principle of locality also applies
to data accesses, though not as strongly as to code accesses.
Two different types of locality have been observed. Temporal locality states that recently ac-
cessed items are likely to be accessed in the near future. Spatial locality says that items whose
addresses are near one another tend to be referenced close together in time. We will see these
principles applied in Chapter 2 .
Focus On The Common Case
Perhaps the most important and pervasive principle of computer design is to focus on the
common case: In making a design trade-off, favor the frequent case over the infrequent case.
This principle applies when determining how to spend resources, since the impact of the im-
provement is higher if the occurrence is frequent.
Focusing on the common case works for power as well as for resource allocation and per-
formance. The instruction fetch and decode unit of a processor may be used much more fre-
quently than a multiplier, so optimize it first. It works on dependability as well. If a database
server has 50 disks for every processor, storage dependability will dominate system depend-
ability.
In addition, the frequent case is often simpler and can be done faster than the infrequent
case. For example, when adding two numbers in the processor, we can expect overflow to be
a rare circumstance and can therefore improve performance by optimizing the more common
case of no overflow. This emphasis may slow down the case when overflow occurs, but if that
is rare then overall performance will be improved by optimizing for the normal case.
We will see many cases of this principle throughout this text. In applying this simple prin-
ciple, we have to decide what the frequent case is and how much performance can be im-
Search WWH ::




Custom Search