COMPUTER CACHE MEMORY WINDOWING

Abstract: A computer level 1 cache memory design with cache windowing divides a large level 1 cache into smaller sizes called windows, allowing the cache to provide more data faster to the CPU. Cache windowing provides the fast access times of a small level 1 cache through fewer, shorter paths and less circuitry than a large cache with multiple associative cache sets. Cache windowing allows context switching to occur with a simple change in cache window designation, eliminating the wait for cache reloading. Simulations of real cache implementations show an average of approximately 30 % improvement in CPU throughput with cache windowing, scaling with CPU speed increases. The resulting system 1) maintains or improves CPU utilization rates as CPU speeds increase, 2) provides large level 1 caches while maintaining cache access times of one CPU clock cycle, and 3) provides high CPU utilization rates for those processing applications where locality of memory references is poor (e.g., networking applications).

Description: COMPUTER CACHE MEMORY WINDOWING FIELD OF THE INVENTION This invention relates generally to internal computer cache memory which includes central processing unit (CPU) on chip cache memory known as level 1 cache, the next memory in line between the CPU cache and main random access memory (RAM) known as level 2 cache, and any additional memory between level 2 and main memory, e.g., level 3 cache. More particularly, the present invention relates to improving cache performance through "cache windowing" to speed up the execution of networking and non networking applications on a computer. BACKGROUND OF THE INVENTION Processing capabilities of computers have been increasing dramatically over the last ten years. CPU's available in both personal computer and work station class computers commonly operate at 300 megahertz (MHz) and higher and are capable of executing 100 million instructions per second (MIPS). However, the realization of the full potential of these processors has been limited by the memory subsystem inside computers. The memory subsystem includes cache memories on the CPU chip known as level 1 cache and external CPU chip cache memories known as level 2 and level 3 cache. Random access memory (RAM) and primary storage (hard disk) round out a computer memory subsystem. The memory is unable to supply data and instructions to CPUs at a rate at which the CPU could consume data and instructions. CPUs are rarely busy more than 33% of the time and spend the vast majority of time idle waiting for memory to supply data and instructions. RAM has an access time of approximately 60 nanoseconds (ns). A modern reduced instruction set computer (RISC) CPU running at 250 MHz can execute up to four instructions involving many bytes of data in 4 ns, or 15 times the rate at which RAM can supply data and instructions. Without any other components, this CPU would typically be idle 56 out of every 60 ns, or 93.3% of the time. A number of techniques have been implemented to span the speed gap between RAM and the CPU in order to keep the CPU supplied with data and instructions at a higher rate than just RAM alone can provide. Cache memory is the main technique employed to bridge the speed gap. Cache memory relies on the principle of locality of reference in order to anticipate the data and instructions required by the CPU in the near future. The data and instructions required by the CPU in executing application programs tend to be located in adjacent memory locations. As the CPU executes instructions, consumes and generates data, the instructions and data tend to be read or written into adjacent memory locations. The next required memory access tends to be very near the last memory location accessed. This is the principle of locality. As a result, cache memory is used to fetch and hold not only the immediately required data and instructions, but also some amount of data and instructions near the locations required by the CPU at a given time. While the CPU is busy executing current instructions working on current data, cache memory is downloading instructions and data from RAM memory near those locations currently used by the CPU in anticipation of near term CPU data and instruction needs. Fetching data and instructions from RAM is overlapped with CPU execution of current instructions and data allowing the CPU to continue executing instead of waiting for slow RAM accesses to complete. Since cache memory can also only access RAM at the RAM speed of approximately 60 ns, in order to keep the memory pipeline near full with required data and instructions, several levels of cache memory are used. A level 2 cache is relatively large and loads large amounts of instructions from RAM into its memory. A level 1 cache is relatively small and loads smaller amounts of data and instructions into its memory from the level 2 cache. Each level of cache memory gets progressively smaller and faster in access time the further down in the memory pipeline from RAM. Level 2 caches are approximately 1 megabyte (MB) in size and have access times approximately two to three times faster than RAM, typically in the 20 ns range. A level 1 cache is relatively small since it must be located on the CPU chip, approximately 64 kilobytes (KB) in size, and has an access time typically equal to the CPU clock rate, in the range of 4 ns. If present, a level 3 cache would sit between level 2 and RAM, would hold 8 MB or more, and would have an access time near that of RAM, approximately 60 ns. The net result of this elaborate memory subsystem is to improve the CPU utilization from 6% without cache memories to approximately 33%. Present cache memory subsystems do not solve three main problems associated with cache memories: 1. Maintaining or improving CPU utilization rates as CPU speeds increase; 2. Providing larger caches while maintaining cache access times of one CPU clock cycle, and 3. Providing high CPU utilization rates for those processing applications where locality of memory references is poor. As CPU speeds continue to increase and memory speeds stay relatively constant as they have done for the last 10 years, the rate of CPU utilization continues to drop as the CPU spends more and more time waiting for cache memory to be filled with the required data and instructions. If the CPU utilization decreases with increasing CPU clock speed, the CPU performance advancements are negated. As CPU speed increases, in order to keep the CPU supplied with the required data and instructions to process, cache memory subsystem of a computer must supply data and instructions at a faster rate. There are only two ways to increase the rate of cache memory transfer, speed up the cache memory access times or increase the size of the cache memory. These two options are at odds with one another. Increasing the cache memory size, though feasible with reduced chip feature sizes, increases the access times at the square of the size. For those cases where locality of reference is not good, e.g., applications performing network data processing, the rate of CPU utilization drops significantly, below the 10% mark. A simple scaling of the present cache memory architecture is not a viable approach to improve or maintain present performance levels in an environment of faster and faster CPU speeds. Increasing the size of level 2 or higher level cache memories (or even increasing RAM), provides little or no performance improvement. In-line or backside level 2 caches have been implemented that improve performance substantially for the cases where good locality of reference exists. This approach uses a separate memory bus between the level 2 cache and the CPU that can operate level 2 caches at the speed of the CPU clock. With this approach, level 1 cache performance is the limiting factor and the limitations on level 1 cache halt further performance improvement. Increasing level 1 cache size to 1 MB or more would yield substantial performance improvement only in the cases where locality of reference exists. Increasing level 1 cache size is limited by two factors: a) the size of a CPU chip is limited in terms of the number of components that can be placed in an area due to heat dissipation and physical limitations and b) as memory size is increased, access time is increased exponentially. In all current systems, nothing has been done to provide good performance when CPU speed increases nor for cases where poor locality of reference exists. What is needed is a cache memory architecture and design that 1) will provide at least the current level of memory subsystem performance at increased CPU speeds, 2) will provide larger level 1 caches while maintaining cache access times of one CPU clock cycle and 3) will provide a substantial performance improvement for executing an application or mix of applications that exhibit poor locality of reference. This invention provide all three needs in a simple and straight forward fashion through the concept and design of "cache windowing". SUMMARY OF THE INVENTION It is an object of the present invention to provide a higher performance internal computer cache memory architecture and design than currently exists with conventional microchip architectures. It is a further object of the present invention to provide a cache memory system that implements "cache windowing." It is a further object of the present invention to provide a cache memory system that can be applied with a variety of semiconductor fabrication technology and CPU performance. It is a further object of the present invention to provide a cache memory that provides the CPU with data and instructions at rates which promote high CPU utilization rates at all CPU speeds, especially at speeds exceeding 300 MHz. It is a further object of the present invention to provide a larger level 1 cache memory system that has a one CPU clock cycle access time. It is a further object of the present invention to provide a cache memory system that provides high CPU utilization rates for processing those applications having low locality of memory references. It is yet another object of the present invention to speed up the execution of applications performing operations over a computer network as well as networking applications executing while non networking applications are also executing on the same machine. This invention, cache windowing, is a method of making a large cache memory, particularly level 1 cache, out of small cache windows to provide the speed advantages of a small cache while providing the performance benefits of a large cache. Cache windowing can also be applied at higher cache levels such as in level 2 and 3 cache memories. BRIEF DESCRIPTION OF THE DRAWINGS Figure 1 shows how cache windows provide a large cache using a number of small segments (cache windows) thereby retaining the fast access times of a small cache while providing the benefits of a large cache and dedicated caches. Figure 2 shows how cache windows can be implemented with new cache/CPU designs. Figure 3 shows how cache windows can be implemented with existing cache/CPU designs. Table 1 shows the cache parameters used to simulate the performance improvement of cache windowing. Table 2 lists the level 1 cache performance improvement simulation results. DETAILED DESCRIPTION OF THE INVENTION Referring to Figure 1, an overview of the level 1 cache windowing concept and design is shown. The level 1 cache windowing concept can be applied to all levels of the memory subsystem, including level 2 and 3 cache memory, and even main memory - RAM. The level 1 cache 100 is composed of a number of separately addressable cache segments or windows 101 - 104. The size of the windows need not be of an equal number of cache lines, blocks or bytes. Each cache window is partitioned into two cache parts: 1 ) an instruction cache (I-Cache) 105 and 2) a data cache (D-Cache) 106. The size of the I-Cache and D- Cache parts of a cache window need not be of equal size. While not necessary for the functioning of the present invention, implementation is simplified if both the cache window sizes and the I-Cache and D-Cache partitions are set to the same values. Candidates for fixed value are 64 KB for the window size with 32 KB I-Cache and D-Cache partitions within the window. Each window is associated with a separate application program, process, or executable thread (collectively "executable entities") running on the machine and executed by the CPU. In Figure 1, a non networking application such as a window manager is assigned to window 1 102 which has a size of 64 KB divided into 32 KB of I-Cache 107 and 32 KB of D-Cache 110. A networking application 108 such as a World Wide Web (WWW) browser is assigned to cache window 2 103 which has a size of 128 Kilobytes (KB) divided into a 32 KB I-Cache 108 and a 96 KB D-Cache 111. The final application process running on the CPU, application N, is assigned to the last window, window N 104 which has a size of 64 KB divided into 36 KB of I-Cache 109 and 28 KB of D-Cache 112. A window number is saved as part of the application processes state information. When an executable entity returns to execution after being suspended, the window control and management logic 119 will select the correct cache window. Once selected, the cache will act as does current technology level 1 cache with associated policies and physical connections. All of the cache windows 102 - 104 sum up to the total size of the cache, in this case 1 MB. As each executable entity gains control of the CPU to begin execution, the Window Number Selector 116 provides the address of the particular cache window assigned to that 1 executable entity 116. The selected window then becomes the active window 115. Any 2 number of methods may be used to provide the Window Number Selector 116. The 3 application process identifier assigned by the Operating System (OS) may be used or the 4 CPU register window selector may be used to double as the cache window number selector 5 116. Window number input can be provided via an application program interface (API) 6 system call or system call argument, or by an application program message handler. 7 Once the cache window is identified and made the active window, the window 8 decoder logic switch 117 connects the cache control and management logic 119 to the active 9 window 115 via one set of connection logic and lines 118. The cache control and 10 management logic 119 then connects the main memory bus 120 to the cache window for 11 reading and writing instructions and data to the window in the course of normal operations. 12 When the executing entity is swapped out of the CPU for another executable entity to 13 begin or resume executing, a new active window assigned to that executable entity is 14 selected, e.g., 113 (window N 104) or 114 (window 2 103) and the same control and 15 management logic 118 and 119 is connected to the new active window. 16 Referring to Figures 2 and 3, cache windows can be implemented a number of ways. 17 Referring to Figure 2, a generic CPU chip having additional (over the usual 32 to 64 KB of 18 level 1 cache found in 1997 CPU chips) physical level 1 cache memory to implement cache 19 windowing is shown. The prefetch and dispatch unit 200 contains an instruction and cache 20 buffer for each window 201 - 203. The prefetch and dispatch unit 200 provides instructions 21 204 to a memory management unit (MMU) 205 which contains a table lookaside buffer 22 (TLB) for each window 206 - 208. This reduces TLB misses and increases level 1 cache 23 performance. The MMU 205 can contain less than one TLB per window, but must contain at 1 least one TLB to match cache window content addresses. Instructions 209 from the MMU 2 are sent to the Load Store Unit 210 where separate load and store queues 211 for each 3 window D-Cache 212 - 214 access data from the window data caches 212 - 214. The level 2 4 cache supplies instructions 218 to the I-Cache partitions of the level 1 cache windows 201 - 5 203 and also supplies and receives data 215 from the D-Cache partitions of the level 1 cache 6 windows 212 - 214. The Memory Interface Unit (MIU) 219 supplies access and control for 7 all cache levels to receive instructions, and to receive and write data to and from main 8 memory (RAM) 220. In this approach, large level 1 caches may be implemented which 9 behave as small caches since only one window's worth of cache memory is active and 0 accessed at a time. The window size will determine the speed of the cache, not the overall 1 cache size. 2 Referring to Figure 3, cache windowing is implemented as a minor modification to 3 the existing CPU level 1 cache designs. In Figure 3, the existing level 1 cache memory 321 4 and 322 of approximately 64 KB is divided into windows 301 - 303 and 312 - 314. Key 5 differences between this implementation approach and that noted in Figure 2 can be seen. 6 The prefetch and dispatch unit 300 contains only one instruction and cache buffer for all 7 windows 321, as in existing level 1 cache technology. The prefetch and dispatch unit 300 8 provides instructions 304 to a MMU 305 which contains only one TLB 306, the existing 9 cache technology TLB 306, for all cache windows 301 - 303 and 312 - 314. Instructions 309 0 from the MMU are sent to the Load Store Unit 310 where a single load and store queue 311 1 for all window D-Caches 312 - 314 accesses data from the window data caches 312 - 314. 2 The level 2 cache supplies instructions 318 to the I-Cache partitions of the level 1 cache 3 windows 301 - 303 and also supplies and receives data 315 from the D-Cache partitions of the level 1 cache windows 312 - 314. The MIU 319 supplies access and control for all cache levels to receive instructions, and to receive and write data to and from main memory (RAM) 320. In this approach, a small level 1 cache is divided into smaller cache windows. The advantage of this approach over that depicted in Figure 2 is that cache windows are implemented without the need for major CPU cache modifications. The drawback of this implementation of cache windows is that it results in a smaller cache for each application thereby limiting the number of windows that can be implemented and restricting cache performance. Advantages Cache windowing, as depicted in Figures 1 - 3, solves the shortcomings of present level 1 cache memory subsystems. Cache windowing maintains or improves CPU utilization rates as CPU speeds increase by supplying the CPU with more cached data at the fastest rate that the CPU can handle. By implementing a large level 1 cache, the CPU can consume data and instructions at a faster rate without waiting for cache memory contents to be updated. The CPU will be less likely to exhaust the cache contents before new data and instructions are available in the cache. Cache windowing provides the additional data and instructions of a larger level 1 cache while maintaining the cache access times of small caches, one CPU clock cycle. Because only a window size worth of cache memory is ever active and accessed at one time, the inductive charge costs and path lengths are kept low enough to provide a one CPU clock cycle cache access time. By switching from one cache window to the next, the delay from loading cache with new instructions and data from either higher level caches or main memory are avoided, maintaining high CPU utilization rates at high CPU clock rates. While the CPU is working out of one cache window, the other cache windows can be loaded with the soon- to-be-needed instructions and data. By allocating cache windows on an executable entity by executable entity basis, one executable entity does not compete with another for cache contents. One executable entity does not overwrite the cache contents of another executable entity, thereby greatly reducing or eliminating the CPU waiting for cache updates due to context switches and cache updating. In addition, by allocating several cache windows to executable entities that have poor memory locality of reference, such as networking applications, the chances of finding the needed instructions or data in cache increase tremendously, reducing or eliminating CPUs wasting clock cycles waiting for cache memory to be updated with the needed instructions or data. Cache windowing can therefore be used to turn poor memory locality of reference into high cache hit ratios and hence faster CPU execution. Mitigating the effects of poor memory locality of reference is one factor that makes cache windowing a candidate for all levels of cache memories, not just level 1 caches. In addition, cache windows could be adjusted to optimize cache hit ratios for the type of executable entity. For example, network applications process more data than the number of instructions they execute. A cache window with an 80% D-Cache and 20% I-Cache partition is possible providing higher cache hit ratios for applications which access more data than instructions. Cache windowing can provide different executable entities with different cache sizes or even cache replacement policies. Windows of different sizes with different management policies could be allocated to different executable entities, or executable entities could be allocated a different number of fixed size windows. For example, some applications could be assigned several cache windows. Cache windowing to achieve larger cache sizes requires less circuitry than non-windowing methods such as multiple associative cache sets. Because only a portion of the cache is accessed and active at one time, the cache window, the number of decoders, address lines, memory line connections and path lengths are reduced over other approaches. Once a cache window is selected, the cache and associated controlling management logic operates as a current Level 1 caches operate. A CPU cache architecture has been shown having alternative embodiments of cache windowing illustrated through RISC implementation examples. Those skilled in the art will appreciate that other embodiments of the present invention will be possible without departing from the concept of the invention as disclosed. RESULTS Simulations were performed using a Commercial-Off-The-Shelf (COTS) cache simulator which simulates the level 1 cache operation of the current (1997) SUN Microsystems UltraSP ARC 1 CPU chip cache performance. For all experiments, the additional cache parameters used for the analysis tools are according to the current UltraSPARC 1 microprocessor level 1 cache design and are summarized in Table 1. The overall performance of two cache windows versus a single unified level 1 cache that is shared between non networking and networking applications is depicted in Table 2. Using the 47% improvement for instruction and data read and write misses (I+D rw misses) from Table 2, yields an average performance improvement in CPU throughput of nearly 30%. CPU throughput is governed by CPI, the number of clock cycles per instruction of application processing. CPI = iCPI + mCPI, where iCPI is the ideal cycles per instruction assuming a perfect memory system with no delays ever. mCPI is the number of memory cycles per CPI, or the number of clock cycles the CPU waits on the cache memory subsystem to have the needed instructions and or data in the level 1 cache. The value of iCPI is between 1.3 and 1.7, based on simulations and experimental trials with many processors. The mCPI is typically between 2.7 and 3.0 for any current high performance system. Using the values of 1.7 for iCPI and 3.0 for mCPI will yield the minimum improvement for a given reduction in mCPI. Using: CPI current = iCPI+mCPI current CPI ne = iCPI + mCPI new then CPI new = 1.7 + (1-0.47) x 2.7 = 3.131 CPI CUITCnt = 1.7 + 2.7 = 4.4 CPI new / CPI current = 3.131/4.4 = 0.712 = (1-0.712) x 100% = 28.8 % improvement.

Claims: CLAIMS I claim: 1. A method for providing computer cache memory windowing comprising: Creating a plurality of cache windows associated with a CPU chip utilizing cache and management and control logic; Assigning a different executable entity to each of the plurality of cache windows; Assigning an executable entity to more than one of the plurality of cache windows; Saving a window number as part of the executable entity state information of each cache window; Selecting a cache window based upon the window number; and Making the selected cache window the active cache window. 2. The method for providing computer cache memory windowing of claim 1 wherein the cache is on the same computer chip with the CPU. 3. The method for providing computer cache memory windowing of claim 1 wherein the cache is located on a chip different from the CPU. 4. The method for providing computer cache memory windowing of claim 1 wherein the executable entities are taken from the group consisting of applications, processes and executable threads. 5. The method for providing computer cache memory windowing of claim 4 wherein the applications, processes and executable threads are networking applications, networking processes and networking executable threads. 1 6. The method for providing computer cache memory windowing of claim 4 wherein the 2 applications, processes and executable threads are non-networking applications, 3 processes and executable threads. 4 7. The method for providing computer cache memory windowing of claim 1 wherein 5 each of the plurality of cache windows is of equal size. 6 8. The method for providing computer cache memory windowing of claim 1 wherein 7 each of the plurality of cache windows is of a size different from the other cache 8 windows. 9 9. The method for providing computer cache memory windowing of claim 1 wherein the 10 plurality of cache windows is created from partitioning the CPU cache. 11 10 The method for providing computer cache memory windowing of claim 1 wherein the 1 *) plurality of cache windows is created by partitioning a single physical cache. 13 11 The method for providing computer cache memory windowing of claims 2 or 3 wherein each of the plurality of cache windows comprises a separate physical cache. 15 12. The method for providing computer cache memory windowing of claim 11 wherein 16 each of the plurality of cache windows is partitioned into at least two parts. 17 13. The method for providing computer cache memory windowing of claim 12 wherein 18 the two cache parts are data cache and instruction cache. 19 14. The method for providing computer cache memory windowing of claim 13 wherein 20 the data cache and instruction cache are of equal size. 21 15. The method for providing computer cache memory windowing of claim 13 wherein 22 the instruction cache and the data cache are of a size different from one another. 23 16. The method for providing computer cache memory windowing of claim 5 wherein the 1 network executable entity is a world wide web browser. 2 17. The method for providing computer cache memory windowing of claim 1 wherein the 3 selecting of a cache window is based on an executable entity identifier. 4 18. The method for providing computer cache memory windowing of claim 4 wherein the 5 selection of the cache window occurs based upon application program interface calls. 6 19. The method for providing computer cache memory windowing of claim 4 wherein the 7 selection of the cache window occurs based upon system calls made by an executable 8 entity. 9 20. The method for providing computer cache memory windowing of claim 1 wherein the 10 selecting of a cache window is based upon CPU register window selection. 11 21. The method for providing computer cache memory windowing of claim 1 wherein the 12 cache access time is one clock cycle of the CPU. 13 22. The method for providing computer cache memory windowing of claim 1 wherein the 14 cache access time is more than one clock cycle of the CPU. 15 23. The method for providing computer cache memory windowing of claim 13 wherein 16 the instruction cache for an executable entity comprises more than one cache window 17 from the plurality of cache windows. 18 24. The method for providing computer cache memory windowing of claim 13 wherein 19 the data cache for an executable entity comprises more than one cache window from 20 the plurality of cache windows. 21 25. The method for providing computer cache memory windowing of claim 1 wherein the 22 selecting of a cache window occurs using a single set of management and control 23 logic. 26. The method for providing computer cache memory windowing of claim 1 wherein the management and control logic comprises a plurality of sets of management and control logic. 27. The method for providing computer cache memory windowing of claim 1 wherein only one cache window is active at any time. 28. The method for providing computer cache memory windowing of claim 1 wherein more than one cache window is active at one time.

Inventors: SCHUG KLAUS H, SCHUG, KLAUS, H.
Applicants: MCMZ TECHNOLOGY INNOVATIONS LL, MCMZ TECHNOLOGY INNOVATIONS LLC
Application year: 1998
Main classification: G06F12
IPC codes: G06F12