Page 147 -
P. 147

118  CHAPTER 4 / CACHE MEMORY

                  used as a buffer to hold data temporarily that is to be read out to disk. Such a tech-
                                                          2
                  nique, sometimes referred to as a disk cache, improves performance in two ways:
                     • Disk writes are clustered. Instead of many small transfers of data, we have a
                       few large transfers of data. This improves disk performance and minimizes
                       processor involvement.
                     • Some data destined for write-out may be referenced by a program before the
                       next dump to disk. In that case, the data are retrieved rapidly from the soft-
                       ware cache rather than slowly from the disk.
                       Appendix 4A examines the performance implications of multilevel memory
                  structures.


             4.2 CACHE MEMORY PRINCIPLES


                  Cache memory is intended to give memory speed approaching that of the fastest
                  memories available, and at the same time provide a large memory size at the price
                  of less expensive types of semiconductor memories. The concept is illustrated in
                  Figure 4.3a. There is a relatively large and slow main memory together with a
                  smaller, faster cache memory. The cache contains a copy of portions of main mem-
                  ory. When the processor attempts to read a word of memory, a check is made to



                                                       Block Transfer
                                     Word Transfer


                              CPU               Cache              Main memory
                                        Fast              Slow

                                                 (a) Single cache







                                        Level 1    Level 2     Level 3     Main
                             CPU
                                       (L1) cache  (L2) cache  (L3) cache  memory
                                  Fastest     Fast
                                                          Less        Slow
                                                          fast

                                           (b) Three-level cache organization
                           Figure 4.3  Cache and Main Memory


                  2 Disk cache is generally a purely software technique and is not examined in this book. See [STAL09] for
                  a discussion.
   142   143   144   145   146   147   148   149   150   151   152