Identifying random access pages and mitigating their impact on compressible computer memory
By monitoring the spatiotemporal locality of memory requests and selectively managing the compressed form of memory content, the problem of performance loss caused by random access pages in compressed memory is solved and the efficiency and performance of the memory system are improved.
Patent Information
- Application Number
- CN202380021443.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2022-02-15
- Filing Date
- 2023-02-15
- Publication Date
- 2024-09-24
AI Technical Summary
In compressed computer memory, address mapping misses caused by random page access increase memory traffic and performance losses, and it is difficult for existing technologies to effectively identify and mitigate their negative impacts.
By monitoring the spatiotemporal locality of memory requests, the memory areas are classified, the contents of the low spatiotemporal locality area are stored in uncompressed form, and other areas are stored in compressed form, and the bypass type and compressed memory access mechanism are used to process them respectively to reduce misses. bring additional traffic.
Effectively identify and mitigate the negative impact of random access pages on performance, improve the efficiency and performance of memory systems, and reduce memory traffic.
Smart Images

Figure CN118696306A
Abstract
Description
Technical Field
[0001] The present subject matter generally relates to the field of data compression in memory in electronic computers. More specifically, the present invention relates to a method of managing compressible computer memory, an apparatus including logic circuits configured to perform the method, an apparatus for managing compressible computer memory, and a computer system including such an apparatus. Background Art
[0002] Data compression is a general technique for storing and transmitting data more efficiently by encoding frequent data sets more efficiently than infrequent data sets (collection of data). For some reasons, it is interesting to store and transmit data more efficiently in general. In a computer memory, such as a memory that stores data and computer instructions used by a processing device operation, such as a main memory or a cache memory, it is interesting to store the data more efficiently, such as K times, because the size of the memory can then be potentially reduced to 1 / K of the original, the communication capacity that is potentially reduced to 1 / K is used to transmit data between the memory and another memory, and the energy cost that is potentially reduced to 1 / K is used to store and transmit the data inside a computer system or between computer systems and / or between memories. Alternatively, people can store data that is potentially increased by K times in available computer memory compared to without data compression. This is interesting for achieving a computer's potentially K times higher performance without having to add more memory, which may be expensive or may just be less than ideal due to resource limitations. As another example, the size and weight of a smartphone, tablet, laptop / desktop, or set-top box may be limited because a larger or heavier smartphone, tablet, laptop / desktop, or set-top box is less valuable to the end user; thus potentially reducing the market value of such products. However, more memory capacity or higher memory communication bandwidth can potentially increase the market value of the product because more memory capacity or memory communication bandwidth can result in higher performance, thereby increasing the usefulness of the product.
[0003] In summary, in the overall landscape of computerized products including standalone devices or interconnected devices, data compression can potentially improve performance, reduce energy costs, increase available memory communication bandwidth, or reduce the cost and area consumed by memory. Thus, data compression has broad utility in a wide range of computerized products other than those mentioned herein.
[0004] In order to increase the size or transmission capacity of computer memory by using data compression, an address mapping mechanism is needed, which maps fixed-size pages in traditional non-compressed memory systems to variable-size pages in compressed memory. Such an address mapping mechanism usually includes multiple entries, each of which can map any fixed-size page to any position in the compressed memory. When a compressed page is accessed for the first time, a miss will occur in the address mapping mechanism, which is called an address mapping miss. The miss will trigger metadata fetching in the computer memory to establish a mapping between the fixed-size page and the compressed page. Since this will result in additional memory accesses, which will reduce performance, it is desirable to keep the number of address mapping misses to a minimum.
[0005] The data contained in a non-compressed, fixed-size memory page is logically divided into a fixed number of fixed-size memory blocks. For example, if the fixed-size memory page is 4096 bytes and the fixed-size memory block is 64 bytes, the page will contain 4096 / 64=64 memory blocks. In traditional non-compressed computer memory, each memory request will usually return a fixed-size memory block. In contrast, in compressed computer memory, the memory blocks will be variable-sized, and a memory request may return multiple compressed memory blocks. For example, if all memory blocks are compressed to 1 / 2, each memory request will return two compressed memory blocks. For another example, if all memory blocks are compressed to 1 / 4, each memory request will return four compressed memory blocks.
[0006] Returning to the address mapping mechanism required to locate a compressed page, the memory traffic caused by the additional memory request caused by the address mapping miss can be compensated if at least one memory request for the page will result in at least one additional compressed block that will be accessed later. On the other hand, if the memory request for the page does not result in an additional compressed block that will be accessed later, the address mapping miss for the page will generate additional memory traffic, resulting in a performance loss compared to a conventional system without compression. We call such pages random access pages (a synonym is "frequently accessed pages").
[0007] It is ideal to identify random access pages and eliminate their negative impact. If random access pages can be identified, the additional traffic caused by them can be avoided through mitigation strategies. The present invention proposes a system, method and apparatus for identifying random access pages and mitigating their negative impact on the performance of compressed memory. Summary of the invention
[0008] In general, the present invention proposes methods, apparatus and systems for identifying random access pages and mitigating their negative impact on performance.
[0009] A first aspect of the present invention is a method for managing compressible computer memory. The method includes monitoring memory requests to the computer memory to classify memory regions based on the spatiotemporal locality of memory requests made to the memory regions, wherein when the frequency of memory requests to the memory regions is below a threshold, the memory regions are classified as exhibiting low spatiotemporal locality. The method also includes selectively managing the compressible computer memory based on the classification, such that the memory contents of the memory regions classified as exhibiting low spatiotemporal locality are stored in the computer memory in an uncompressed form, while the memory contents of the memory regions not classified as exhibiting low spatiotemporal locality are stored in the computer memory in a compressed form.
[0010] A second aspect of the invention is a device comprising a logic circuit configured to perform a method according to the first aspect. The device is typically a semiconductor device (electronic device). In an advantageous embodiment, the device can be configured to be connected between a memory controller and a cache of a computer system. In an alternative embodiment, but not limited to, the device can be included in or implemented by a memory controller of a computer system.
[0011] A third aspect of the present invention is a device for managing compressible computer memory. The device has a memory area classification device, which is configured to monitor memory requests for computer memory and classify memory areas based on the spatiotemporal locality of memory requests made to the memory areas. When the frequency of memory requests to the memory area is lower than a threshold, the memory area is classified as exhibiting low spatiotemporal locality. The device also has a selective computer memory management device, which is operably connected to the memory area classification device. The selective computer memory management device includes a bypass-type memory access mechanism and a compression-type memory access mechanism. The bypass-type memory access mechanism is configured to process the memory contents of the memory area that will be classified as exhibiting low spatiotemporal locality in an uncompressed form in the computer memory. The compression-type memory access mechanism is configured to process the memory contents of the memory area that is not classified as exhibiting low spatiotemporal locality in a compressed form in the computer memory.
[0012] A fourth aspect of the present invention is a computer system comprising one or more processors, a compressible main memory, and an apparatus according to the second aspect or the third aspect of the present invention.
[0013] In a typical embodiment, each memory region will constitute a memory page in a computer memory, or a series of consecutive memory pages in a computer memory, each memory page comprising a number of memory blocks, and the compressed memory content can be retrieved from the computer memory as a compressed package, the compressed package comprising a number of compressed consecutive memory blocks, the number of compressed consecutive memory blocks being compacted into one physical memory block. In a typical embodiment, a memory region will be considered to exhibit low spatiotemporal locality when the number of memory requests for memory blocks that belong or will belong to the same compressed package is below a threshold. Alternatively, the memory region exhibits low spatiotemporal locality when a first memory request for a memory block in the memory region is not followed by a second memory request for a second memory block that belongs or will belong to the same compressed package within a monitored time period.
[0014] In general, whenever computer memory compression is mentioned herein, those skilled in the art will understand that any known compression principle may be employed, such as entropy-based coding, statistical coding, dictionary-based coding, delta-based coding, without limitation.
[0015] Further aspects as well as objects, features and advantages of the disclosed embodiments will appear from the following detailed patent disclosure, the attached dependent claims and the accompanying drawings.
[0016] In general, all terms used in the claims should be interpreted according to their ordinary meaning in the technical field, unless explicitly defined otherwise herein. Unless explicitly stated otherwise, all references to "one / an / the [element, device, part, means, step, etc.]" should be openly interpreted as referring to at least one instance of an element, device, part, means, step, etc. Unless explicitly stated otherwise, the steps of any method disclosed herein do not have to be performed in the exact order disclosed. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 An exemplary computer system is depicted that includes a microprocessor chip having one or more processing units, an exemplary cache hierarchy of three levels, and one or more memory controllers coupled to one or more off-chip memories.
[0018] Figure 2 Depicts the layout of an uncompressed memory page.
[0019] Figure 3 Depicts the layout of a compressed memory page.
[0020] Figure 4Describes how compression metadata is retained in the memory address space along with the compressed data.
[0021] Figure 5 is a general diagram of a memory compression apparatus (ie, an apparatus for accessing compressed computer memory).
[0022] Figure 6 Depicted is a flow chart for a read memory request.
[0023] Figure 7 Means for a modified address translation table ATT are depicted.
[0024] Figure 8 A method for page characterization of compressed pages is described.
[0025] Fig. 9 Depicts the shadow tag structure.
[0026] Fig.10 An apparatus for characterizing uncompressed (bypassed) pages is depicted.
[0027] Fig.11 A method for characterizing uncompressed (bypassed) pages is described.
[0028] Fig.12 A first implementation of bypassing ATT without history (BP-ATT) is shown.
[0029] Fig.13 A second embodiment bypassing ATT (BP-ATT) is shown.
[0030] Fig.14 Describes the bitmap metadata in memory.
[0031] Fig.15 An apparatus for bitmap caching is depicted.
[0032] Fig.16 A method for bitmap caching is depicted.
[0033] Fig.17 Implementations of a memory compression apparatus are described.
[0034] Fig.18 A method of generally managing compressible computer memory according to one aspect of the invention is described.
[0035] Fig.19 An apparatus for generally managing compressible computer memory according to another aspect of the invention is depicted. DETAILED DESCRIPTION
[0036] This document discloses systems, methods and apparatus for identifying random access pages and mitigating their negative impact on the performance of compressed memory. At the end of the detailed disclosure, various aspects of the invention will be presented in a more general form, with specific reference to Fig.18 and Fig.19 , Fig.18 A method for managing compressible computer memory is described. Fig.19 An apparatus for managing compressible computer memory is described. In order to fully understand and appreciate these broad aspects of the present invention, the description will begin with Figures 1 to 17 Start, then return to Fig.18 and Fig.19 To end.
[0037] Figure 1 An exemplary embodiment of a computer system 100 is depicted. The system includes a microprocessor chip 110 and processors denoted as M1 151, M2 152, and M K The microprocessor chip may be a discrete system or integrated on a system on a chip (SoC) using any available technology. The microprocessor 110 includes P1 131, P2 132 to P N One or more processing units (sometimes referred to as CPUs or cores) and a memory hierarchy at 133. On the other hand, the memory hierarchy includes several cache levels, such as Figure 1 The three levels shown by way of example and denoted as C1, C2, C3, and the memory modules M1 to M K These tiers can be implemented with the same or different memory technologies, such as SRAM, DRAM, or any type of non-volatile technology, including, for example, phase change memory (PCM), STT-RAM, or high bandwidth memory (HBM).
[0038] The number of cache levels may vary in different implementations, and exemplary implementation 100 depicts three levels, with the last cache level being C3 120. The levels are connected using some sort of interconnect, such as a bus or any other interconnect network, such as a grid, hypercube, etc. In the exemplary implementation, levels C1 and C2 are connected to a CPU denoted as P i The corresponding processing unit i (e.g. Figure 1 P1 in is private and can only be accessed by it. It is well known to those skilled in the art that alternative embodiments may have any number of private cache levels, or, as an alternative, all cache levels are shared, such as Figure 1120 in the third level C3 of the cache hierarchy. Any implementation is possible with respect to including data in the cache hierarchy and will be understood by those skilled in the art. For example, C1 may be included in C2, while C2 may not be included in level C3. Those skilled in the art will understand alternative implementations.
[0039] Figure 1 The computer system 100 includes MCTRL1 141, MCTRL2 142 to MCTRL L One or more memory controllers of 143. The last cache level (in Figure 1 The memory controller is connected to the memory module M1 to M3. K The memory controller may be integrated on the microprocessor chip 110 or may be implemented external to the microprocessor chip. Finally, the computer system runs one or more tasks. A task may be any software application or a portion thereof, for example, as in a multithreaded application.
[0040] Identify and mitigate the impact of random access pages on compressed memory systems
[0041] Computer systems, such as Figure 1 As illustrated in the embodiment of FIG. 1 , the main memory (eg, memory modules M1 151 to M152) may be affected by the cache memory. k 153) is troubled by limited capacity, regardless of the tier (e.g. Figure 1 C1, C2, and C3 in the memory hierarchy). Limited cache capacity may manifest itself as a higher fraction of memory requests that must be serviced at the next level in the memory hierarchy, resulting in performance loss or higher energy consumption. To alleviate this problem, one may consider increasing the cache capacity, thereby reducing the number of requests that need to be serviced by the next level in the memory hierarchy.
[0042] In another case, the link bandwidth between the memory controller and the memory (e.g. Figure 1 The link bandwidth between the MCTRL 1141 and the M1 151 in the memory controller may be limited. Compressing the data in the memory and / or cache can alleviate the above capacity and / or bandwidth limitations by allowing more data to be stored in the memory and / or cache and more data to be transferred between the memory controller and the memory device.
[0043] In a compressed memory system, the size of the compressed data is smaller. First, let's look at Figure 2 Uncompressed page layout 200. From Figure 2 As can be seen from FIG. 1 , the size of the uncompressed page 210 can be 4KB (kilobytes). In a system without compression, the size of each memory block 220a will be 64B (bytes). Therefore, Figure 2 There are 64 memory blocks 220, denoted as Blk0, Blk1, ..., Blk63. Now consider Figure 3 300. In systems that apply compression, the memory block size is usually less than 64B. For example, although Figure 2 Each of the memory blocks 220 (Blk0, Blk1, ..., Blk63) in FIG. 1 is 64 bytes, but the size of the memory block 330 in the compressed memory system is variable, such as Figure 3 Here, the compressed sizes 330 of memory blocks 320a (Blk0), 320b, 320c (Blk2), and 320d are 48B, 5B, 53B, and 19B, respectively. Compared to uncompressed data, compressed data can more efficiently utilize the space where it is stored. However, due to its variable size, its location is unknown. Therefore, the compressed memory system requires metadata to locate the compressed data.
[0044] In an exemplary compressed memory system, Figure 4 The memory layout 400 depicted in FIG. 4 includes compressed data 440 allocated in memory and address translation table (ATT) metadata 480. The ATT metadata 480 holds information about where each individual memory block is contained in the compressed memory address space 420.
[0045] The prior art covers many implementations of metadata layouts for locating compressed memory blocks. In one implementation, the metadata stores the location of the compressed memory block. In a second implementation, the metadata stores the size of the compressed memory block. In yet another implementation, the metadata may store both the location and size of the compressed memory block. In an alternative implementation, the metadata may additionally or alternatively record the status of whether the memory block is compressed, or if multiple algorithms are used, the compression algorithm used.
[0046] Computer systems organize multiple memory blocks together into memory pages ( Figure 2 210 and Figure 3 310 in FIG. 310). Due to this data organization, it is natural to group together the compressed metadata of memory blocks belonging to the same memory page. In one embodiment, a memory page may refer to an entity managed by an operating system (OS), referred to as an OS memory page. In another embodiment, a memory page may refer to a series of memory blocks that are all mapped to a group of memory devices, such as those managed by a specific memory controller (e.g., Figure 1 MCTRL1 141) controlled by Figure 1 M1151 in. In this embodiment, the memory page organization may not be equivalent to the OS memory page. This is particularly beneficial for computer systems with memory interleaving, where OS memory pages are interleaved across multiple memory controllers. If the metadata is organized based on OS data, the metadata for a particular page will be distributed across multiple memory controllers and their associated memory devices. On the other hand, if the metadata is organized to reflect how the data is mapped to one memory controller, this will make metadata processing more efficient.
[0047] Figure 5 An exemplary device 500 for accessing compressed computer memory is shown, which will be referred to as a compressed memory device in the following shorthand manner. The compressed memory device 500 is configured to compress data in the main memory 540 in order to expand its capacity or increase the available bandwidth between the memory controller and the memory modules of the exemplary compressed memory system. Figure 1 The exemplary computer system of FIG. 1 is shown in FIG. 1 , wherein the compressed memory device 500 is typically connected to the storage medium 500 by Figure 5 The compressed main memory 540 is connected to a memory controller, such as MCTRL1 151, via connections 543, 542, 549 and 525, and is connected to the last level of cache memory C3 via connections 598, 508 and 504. It will therefore be placed between the memory controller and the last level of cache memory. Alternatively, the compressed memory device 500 may be implemented by / integrated with a memory controller. Figure 5 When the device 500 receives memory write requests 504, they are first buffered in the write buffer 510. When the write request exits the write buffer at 513, the data to be written is compressed by the compressor unit 520 (CMPR) and a memory transaction is created, where the compressed data 525 is sent to the main memory 540. Since the data is now compressed in memory and can have a smaller size, as shown in FIG. Figure 3 As depicted, the requested memory block may therefore be located in a different memory location than in an uncompressed memory system.
[0048] The location and / or size of the compressed memory block is reflected in the compression metadata, which is read or updated by the memory compression device 500. In a similar manner, the memory compression device 500 receives a read request 508. The granularity of the read request is a memory block. The memory compression device 500 must look up the metadata corresponding to the requested memory block regarding its location and / or size to determine the location of the compressed data in the main memory 540. When performing this process, a read request 542 can be issued to the main memory 540. The main memory 540 will respond with compressed data 543. The memory compression device 500 decompresses the compressed data on the fly through the decompressor unit 550 (DCMPR) and returns an uncompressed memory block 554 to the requester, as shown in 598.
[0049] Looking up metadata before issuing a read or write memory transaction will result in delaying the read or write memory transaction. While write memory transactions are considered less important, memory read transactions are on a critical memory access path and must be processed as quickly as possible to avoid degrading the performance of the underlying computer system.
[0050] Memory compression devices have adopted solutions to keep some of the metadata on the chip in a file called Figure 5 The structure of the address translation table (ATT) 570 in the memory compression device 500 is used to speed up metadata lookup. In this way, the latest metadata can be stored on the chip. In alternative embodiments, more frequent metadata is retained instead. In other embodiments, the metadata stored in the ATT depends on the metadata extraction / eviction strategy adopted by the memory compression device 500.
[0051] continue Figure 5 As with other units in the decompressor unit 550, a prefetch buffer 590 is attached. To understand the purpose of the prefetch buffer, recall that main memory typically responds to read requests with a fixed-size granularity (e.g., 64 bytes). However, because the main memory data is compressed, this may correspond to several contiguous logical memory blocks. Although the requested blocks will be returned, it may be helpful to retain the unrequested contiguous memory blocks for prefetching. If they are accessed later, they can be avoided from being requested from memory, saving the performance loss caused by the latency and memory traffic they would cause.
[0052] Assuming compression is applied using a memory block granularity (e.g., a fixed granularity for accessing memory), in a first exemplary embodiment, a plurality of consecutive compressed memory blocks (e.g., X) can potentially be compressed into one block, thereby achieving a compression of X: 1. In a second embodiment, a first plurality of consecutive compressed memory blocks (e.g., X) can potentially be compressed into a second plurality of blocks (e.g., Y), where X>Y, thereby achieving a compression of X: Y. The plurality of consecutive compressed memory blocks packaged together is referred to as a compression package.
[0053] Figure 6 Shows Figure 5 Flowchart 600 of a memory read request 508 of an exemplary memory compression memory device 500 in FIG. First, at 610, find Figure 5 The prefetch buffer (PB) 590 in the . If the requested data is found, it can be used immediately Figure 5 The request is made using the uncompressed data 598 from the PB in the PB—that is, the request is completed at 630. If the data is not in the PB, then the request must be completed at 650. Figure 5 As depicted, by sending a read request 508 to Figure 5 ATT 570 Figure 5 On the other hand, if the ATT does not contain metadata for the requested memory block, a read request 542 will be issued to the main memory to extract the compressed memory data at 690, and then the request will be responded to (with Figure 5 In the case of an ATT miss, the metadata for the page must first be fetched from memory at 670; Figure 5 After the metadata 549 arrives at the memory compression device 500 and is used by the memory compression device 500 to determine the location of the compressed block, a request to the memory at 690 may now be made. Figure 5 When the request is completed and the data arrives at the memory compression device 500, the request can be completed at 630 (with Figure 5 543, 554 and 598 in that order).
[0054] In a compressed memory system, when a small fraction of memory requests do not require access to memory to obtain data or metadata, memory traffic is reduced and performance can be improved. Figure 5 In an embodiment of the memory compression device 500, when the ATT of a page is not hit, the metadata of the page is extracted and cached in the ATT. This may cause one or more memory transactions. However, if during the life cycle of the metadata in the ATT, Figure 5If there is no single hit for a block belonging to the page in the prefetch buffer 590, it means that the additional traffic for fetching metadata will not be offset, resulting in higher traffic than the conventional system without prefetching. On the other hand, assuming that a single memory transaction is sufficient to bring metadata, a single hit for a block belonging to the page in the prefetch buffer will offset the additional traffic, and the more PB hits there are for the page, the more traffic is saved.
[0055] Pages that may experience additional traffic when fetching metadata are called random access pages. Block accesses to random access pages generally exhibit poor spatial locality. For example, suppose all blocks of a page are compressed to 1 / 4. Then on a prefetch buffer miss, four blocks will be fetched into the prefetch buffer. If the next three consecutive address blocks are never accessed, no traffic is saved. In this example, if only every fourth block of the page is accessed, the benefit of compressing the page will no longer exist. In fact, if the page is not compressed, it can be located without metadata by simply bypassing ATT.
[0056] The present disclosure proposes systems, devices and methods for characterizing and detecting random access pages, and as a mitigation strategy, systems, devices and methods for selectively characterizing and detecting compressed data only for pages that are not considered random access pages (referred to as non-random access pages) in a compressed memory system. In essence, the compression of a page will not only be determined based on the data compressibility alone, but also based on the above-mentioned characterization. This improves the efficiency of the memory compression system because memory blocks belonging to random access pages that do not benefit from compression will remain uncompressed, and there will be little or no performance loss due to metadata access. The present invention also discloses an apparatus and method for determining which pages should be compressed and which pages should remain uncompressed; the latter are processed through a path different from the path used by the compressed data. These pages are called bypass pages because they essentially bypass most of the memory compression device.
[0057] The first part of the present disclosure is an apparatus and method for characterizing memory data based on the spatiotemporal locality of requests to access the data, and determining whether a page should be considered a random access page.
[0058] In an exemplary embodiment of such a memory compression device, the memory compression device may be used Figure 5The memory structures of the memory compression device 500 (e.g., the address translation table (ATT) 570 and the prefetch buffer (PB) 590) are used to determine whether a page should be considered a random access page. However, since these structures cannot be of infinite size, the amount of requests that hit the PB and / or ATT depends on the spatiotemporal locality of the requests at the data granularity organized by the PB and ATT. Therefore, characterizing the access pattern of a memory page as random access or not requires considering the locality exhibited by both the PB and the ATT.
[0059] In a first embodiment of the memory compression device, both PB and ATT may be constructed like caches, but other alternative embodiments may be implemented by those skilled in the art.
[0060] In this exemplary embodiment, the PBs are organized into memory blocks, each of which is 64 bytes in size, since this is the typical granularity of memory access. Alternatively, the PBs may be organized into cache lines, since the primary module that issues memory requests in a computer system is the cache hierarchy of the computer system, and specifically Figure 1 C3 in an example computer system implementation of . A cache line can match a memory block in size, but they can be different sizes. As another alternative, the granularity of a PB can be larger than a cache line or a memory block, and can match the packing granularity of the compressed data, for example, the size of a compressed packet as defined above, such as 2 memory blocks, 4 memory blocks, etc.
[0061] In a second exemplary embodiment, one ATT entry can store metadata for one memory block. Although this may result in a potentially good hit rate for the ATT space, the ATT will not be area efficient because the size of the tag array will be greater than or equal to the size of the data array. (The concept of the tag array will be explained later in this document.) In an alternative ATT structure, assume that the size of each memory block is 64 (=2 6 ) bytes, the metadata stored for each memory block is 7 bits so that any compressed block size (including the size of uncompressed blocks) can be encoded. Alternatively, assuming the physical address width is 48 bits, the metadata stored for the memory block can contain both the size and the position (42+7). The tag array of the ATT, which is used to store the control information of the stored data (i.e., the memory address in the uncompressed address space), will also allocate 48 bits (48-6+1 (efficient bit)+1 (dirty bit)+4 (replacement bit)) for each ATT entry. In addition, extracting metadata will result in inefficient memory traffic utilization because each metadata access will result in wasted memory traffic, i.e., 473 bits are discarded from the 64B memory block, leaving only 49 bits for the requested metadata.
[0062] In an alternative embodiment, metadata is organized using a larger granularity. In an exemplary embodiment, metadata for N consecutive memory blocks is organized together. In this way, the memory location metadata does not need to store the entire address in the memory address space for each memory block, but rather stores an offset from the beginning of the sequence of N memory blocks. This way of organizing metadata for multiple memory blocks together also matches how the translation lookaside buffer (TLB) organizes translations from virtual to physical address space. This embodiment is referred to as ATT organization of metadata in pages.
[0063] Compressed page representation and random access page prediction implementation
[0064] In a first embodiment of the memory compression device proposed in this article, the goal is to characterize the temporal and spatial locality of compressed pages and predict whether one or more of the compressed pages are random access pages. The characterization is performed by tracking the page's residence in the ATT until it is evicted. For example, when a page is accessed for the first time, it will be extracted into the ATT. Accessing the memory block belonging to the page will cause the requested block and possible other consecutive memory blocks to be extracted into the PB. If a page is evicted from the ATT without any PB hitting the block belonging to the page, the page is considered a random access page because the traffic it causes is higher than the traffic it causes when it is not compressed. On the other hand, if the access pattern of the page shows good temporal and spatial locality, such as a page in which blocks are read continuously, it will be accessed multiple times in the ATT and many PB hits may occur. Performing a characterization before the ATT is evicted increases the risk of misprediction. For example, the currently monitored access may not represent the page, or the page access may go through different access phases. For this reason, it can be considered beneficial to have multiple monitoring phases (or windows). Here, the monitoring phase / window corresponds to the lifecycle of the ATT entry for a page, from the point when the page is fetched to the point when the page is evicted.
[0065] A representation of the temporal locality of a page can be implemented in the ATT, i.e., how many read requests hit the page. This information alone is not enough. For example, if only one memory block in a page is accessed one or more times, and all other memory blocks are not accessed, then the page will be predicted to be good for compression, while in fact accessing the memory block will incur overhead due to metadata access. Importantly, if the spatial locality within the page is taken into account, the prediction will be accurate. The spatial locality feature can be extracted by tracking the hit count of the compressed package for each compressed package in the characterization page (as described above). For example, if the compressed package contains four potential memory blocks, accessing one of the four blocks will result in the compressed package being extracted from the memory and inserted into the PB. The hit count of the compressed package at the time of insertion is 0. Any subsequent access to the compressed package is considered a hit, thereby increasing the hit counter. In this way, strided memory access (as shown in the example previously presented, only one memory block of each compressed package in each page is accessed) will result in random access page prediction, which will be accurate. The spatial locality representation can be implemented in the PB, but there are limitations. i) The PB may not necessarily extract all potential blocks of a compressed packet, as this depends on the actual data compression. For example, if the required block is uncompressed, only this block is extracted. Extracting additional memory blocks for the characterization will generate unnecessary traffic overhead, while not extracting will result in a loss of accuracy in the characterization. ii) The PB must be reorganized based on the granularity of the compressed packet; otherwise, if it is still organized based on memory blocks, multiple lookup requests are required to track whether there is at least one block of the target compressed packet. The latter will increase the pressure on the PB.
[0066] In the exemplary embodiment of the memory compression device proposed in this article, the ATT structure is used and a new data structure (called shadow tag (ST)) is introduced to characterize and predict whether the compressed page has the random access pattern as described above. In alternative embodiments, those skilled in the art will recognize that PB can be used to replace ST by realizing the limitations mentioned in the previous paragraphs or solving one or more of the limitations.
[0067] Fig. 9900 in the figure depicts an exemplary implementation of the ST structure. ST 900 can be organized like a cache, but it only contains a tag array 940 that virtually tags memory blocks as being present in the ST without actually extracting the memory blocks from the memory. This makes it possible to simulate the presence of memory blocks in a memory compression device by mimicking the behavior of the PB, but without paying the overhead of transferring data from the memory. The tag array 940 is composed of multiple entries. Each entry 980 in the tag array 940 stores information about the compression package (i.e., several consecutive memory blocks) mapped to the entry, and also includes a block tag 983 (i.e., the addresses of the multiple memory blocks), an efficient bit 986, and a replacement bit 989. If the ST is organized as a set associative cache structure, the replacement bit is used to locate the victim ST entry and replace it. The ST is placed on the read request path before the ATT. This is in Fig.17 (ST 1735) as part of the memory compression device disclosed in this patent.
[0068] The existing ATT structure is further extended by adding one or more counters for each ATT entry (i.e., page) to record how many shadow tag hits the page has before it is eventually evicted from the ATT. Each counter is associated with a monitoring stage (or window) (as defined in the previous section of this document) and tracks the measured ST locality of the compaction package of its associated page: Every time a read request arrives at the memory compaction device, the ST is updated to update its statistics. If the request results in a shadow tag hit, the counter associated with the current monitoring window in the ATT is incremented.
[0069] exist Figure 7The modified ATT is depicted at 700 in FIG. It consists of a tag array 730 and a data array 760. The tag array entries contain control information for each page, such as a tag, a portion of the page address in the uncompressed address space, a valid bit, a dirty bit, and a replacement policy bit, while the data array stores various metadata entries extracted from the memory. The metadata entries 790 in the data array 760 consist of conventional compression metadata 792 (e.g., the location of the memory block, the size of the memory block, etc.) and one or more counters (one counter for each monitoring window) 796, which are used to record the number of shadow tag hits. In one embodiment of the memory compression device, the metadata entry may contain only one counter to record the number of ST hits in the last eviction (i.e., one monitoring window). In an alternative embodiment, multiple N counters are used to record the ST hits for the last N evictions (i.e., multiple monitoring windows or monitoring history). In the latter embodiment, the current counter index 794 is required to determine the last effective counter value or the number of ATT evictions to date so that the ATT knows which counter to update in the current monitoring window. For example, in Figure 7 In the embodiment, the current active counter 798 has a value of 7 until the next eviction, as shown by the counter index 794 being 2, and the counter values are counted from left to right starting from index 0.
[0070] Figure 8 An exemplary implementation of a characterization method 800 for compressed pages is shown. For a read request, the ST is looked up at 810. If it is an ST miss, the compression package associated with the requested memory block is inserted into the ST at 820, otherwise, the ATT is looked up for the page associated with the read request. If it is a hit in the ATT, the last valid ST hit counter of the ATT entry is incremented at 890. If it is a miss in the ATT, the victim ATT entry must be identified at 840. If the victim is invalid (i.e., the valid bit for the ATT entry is "0" in the tag array), it is replaced by inserting the ATT entry from the memory that missed it at 848. The process is completed by updating the ST hit counter in the ATT at 890. On the other hand, if the victim is valid, it is checked whether the history of the ST hit counter is full, i.e., whether all counters have been used. If all counters have not been used, then at 880 the metadata entry is written back to memory as usual and replaced at 848 with a new ATT entry as previously described. On the other hand, if the ST counter history is full, then at 860 the history is evaluated by a page prediction method, some implementations of which are described in the following paragraphs. Figure 8As described above, the ST counter of the page is reset at 870, and the ATT entry is written back to the memory at 880, and then the other steps described above are performed.
[0071] When the number of ATT evictions for a page reaches a historical threshold (e.g., 4 evictions / monitoring window), the value of the ST hit counter recorded in the ATT metadata entry is checked by the page prediction method to evaluate the spatiotemporal locality of the page. The ST hit counter value can be checked in a variety of ways to detect whether a page should be considered uncompressed or compressed.
[0072] In one embodiment of the page prediction method, the evaluation of the ST hit counter can be implemented as a heuristic method that averages the number of ST hits for each ATT eviction; if the average is above a threshold, the page locality is classified as a non-random access page and the page can remain compressed in memory. If the average number of ST hits for each eviction is below the threshold, the page is classified as a random access page and must be decompressed and bypassed from now on. The threshold can be predefined. In an alternative embodiment, the threshold can be dynamically updated. In yet another embodiment, a hysteresis point can be introduced to filter out outliers.
[0073] In a second embodiment of the page prediction method, the evaluation of the ST hit counter can be implemented as a heuristic method that averages the number of ST hits for each ATT eviction and compares the average with a high watermark and a low watermark.
[0074] In a third embodiment of the page prediction method, if all ST hit counters 796 are in use, the values of the ST hit counters can be averaged and stored in one of the ST hit counters, allowing the remaining hit counters to be reused for more measurements. The current counter index must be reset to 0. This can allow the characterization phase for the page to be extended.
[0075] In a fourth embodiment of the page prediction method, a heuristic method may implement low and high cutoffs instead of averages. For example, a page showing 64 ST hits at a time may be considered not to be a random access page, even if the average for multiple monitoring windows is lower; or, alternatively, a page showing 0 ST hits at a time may be considered to be a random access page, even if the average for other windows is slightly better.
[0076] In a fifth implementation of the page prediction method, a heuristic method can be implemented using a combination of average values and low cutoff values / high cutoff values to filter out outliers or bias toward specific access patterns. Depending on the strategy used, this implementation can provide greater flexibility.
[0077] In a corresponding device, multiple ST counters can be selected as powers of 2, so that the division operation of the averaging function is changed to a shift operation to achieve it.
[0078] Other alternatives may be realized by those skilled in the art and all such alternatives are intended to be considered.
[0079] The exemplary implementation described above for characterizing compressed pages and predicting whether they are non-random access pages (and therefore still need to be compressed) or random access pages (and therefore still need to be uncompressed) relies on analyzing read requests. This is because read requests are in the critical path, and therefore, by improving the performance of read requests, computer performance is generally improved.
[0080] In an alternative computer system, write requests are more critical than read requests, so write requests may be characterized instead. In yet another alternative embodiment, both read and write requests may be analyzed. This may result in a higher accuracy of characterization and prediction. In yet another embodiment, a sampling of read and / or write requests may be preferably used for characterization and prediction. One may choose to make a decision to selectively compress only the sampled pages or generalize the decision to a global decision; i.e., if the prediction finds that compression should not be prioritized, all pages are decompressed from now on, or if the prediction finds that compression should be prioritized, the pages are kept compressed.
[0081] The disclosed method and apparatus characterize compressed pages and detect whether one or more of these pages must be decompressed to avoid performance degradation. Pages marked as random access pages and decompressed will be filtered out, but their behavior may change, so the reverse conversion is also required.
[0082] Representation of uncompressed pages and implementation of non-random access page prediction
[0083] To characterize uncompressed pages and determine whether they have good spatiotemporal locality in order to select them for compression, new methods and apparatus are disclosed, which are similar in some properties to those previously mentioned.
[0084] In contrast to characterizing compressed pages using ATT page metadata by storing the history of each page in its metadata entry, characterizing uncompressed pages and predicting whether to be considered compressible based on their spatiotemporal locality requires analyzing pages (as defined in the previous paragraph) that are currently bypassed and therefore cannot easily access their metadata.
[0085] Therefore, different mechanisms are required to characterize and detect random access pages or pages with good spatiotemporal locality (i.e., non-random access pages that are not compressed). Fig.10 1000, and the characterization device requires two new structures: i) bypass page shadow tag (BP-ST) 1040 and ii) bypass page ATT (BP-ATT) 1080. Fig. 9 BP-ST is organized in a similar way to the aforementioned ST in , and its behavior is also similar to Fig. 9 The behavior of the aforementioned ST in BP-ATT is similar to that of the previous ST in BP-ATT. ST tracks the spatial locality of memory blocks at the granularity of compressed packets. BP-ST tracks spatial locality at the same granularity, assuming that memory blocks are compressed and form compressed packets, even if pages are currently bypassed. BP-ATT, on the other hand, is a shadow tag structure.
[0086] A first exemplary embodiment of a characterization apparatus for uncompressed pages uses Fig.12 12. The BP-ATT 1200 depicted in FIG. 12 is composed of a tag array 1230 and a data array 1260, in which there are a plurality of metadata entries 1261. Each metadata entry 1290 corresponding to a plurality of memory blocks organized in a page contains a counter 1294, which is the current BP-ST hit counter for the associated plurality of memory blocks. In this case, the page characterization depends only on the counter value.
[0087] Fig.11 A method 1100 for characterizing uncompressed pages and predicting non-random access pages / random access pages based on the characterization is shown. The read request is first looked up in BP-ST 1110. If it does not hit, it is inserted into BP-ST at 1120, otherwise (BP-ST hit), it is further looked up in BP-ATT. If the latter lookup results in a BP-ATT hit, it is then forwarded to BP-ATT at 1180. Fig.12The stored BP-ST counter 1294 in the hit metadata entry 1290 in is incremented. If the BP-ATT access results in a miss, the BP-ATT entry must be evicted at 1140. If an invalid victim is found at 1148, a new entry is created in the location of the invalid entry and the BP-ST counter is initialized to 0. This does not require any metadata to be advanced from memory, as the characterization method and apparatus analyzes the ST activity of this metadata entry until it is evicted from the BP-ATT. The BP-ST counter is then incremented at 1180 as described above. If an efficient victim is found at 1144, this will trigger the prediction method, which requires the evaluation of page features at 1160. When the prediction is complete, the entry can be invalidated and replaced with a new entry at 1148 as described above.
[0088] Embodiments of the prediction method and apparatus configured to perform the prediction method perform the prediction method by adding this counter (e.g., Fig.12 The value of 1294 in is compared with a threshold to decide whether the page should be considered a non-random access page (to be compressed) or a random access page (remain uncompressed). The threshold is predefined. In an alternative embodiment, it can be dynamically defined.
[0089] A second exemplary embodiment of the characterization method and apparatus comprises Fig.13 BP-ATT 1300 as depicted in FIG. Fig.12 As in , BP-ATT 1300 consists of a tag array 1330 and a data array 1360, but each metadata entry 1390 collects the ST location history across multiple BP-ATT evictions (previously defined as monitoring windows). The organization of BP-ST counters 1396 and 1394 is similar to Figure 7 The ST counters in the ATT of 796 and 794 are organized in the same manner. This requires each uncompressed page to store and maintain a number of additional metadata, which are the values of these counters. This further means that the characterization method for uncompressed pages is similar to the characterization method for compressed pages, because the metadata must be read from memory on a BP-ATT miss and written back to memory on eviction in order to retrieve and maintain the history of previous monitoring windows.
[0090] The exemplary implementation described above for characterizing uncompressed pages and predicting whether they are non-random access pages (need to be compressed) or random access pages (need to remain uncompressed) relies on analyzing read requests. This is because read requests are on the critical path, so generally by improving the performance of read requests, computer performance is generally improved.
[0091] In an alternative computer system, write requests are more critical than read requests, so write requests may be characterized instead. In yet another embodiment, both read and write requests may be analyzed. This will result in better accuracy for characterization and prediction. In yet another embodiment, a sampling of read and / or write requests may be preferably used for characterization and prediction. One may choose to make a decision to selectively compress only the sampled pages or generalize the decision to a global decision; i.e., if the prediction finds that compression should be preferred, then compress all bypassed pages from now on, or if the prediction determines that compression should not be a preferred option, then keep the bypassed pages in uncompressed form.
[0092] General Implementation Method - Bypass
[0093] Another apparatus and method disclosed herein shows how to manage previously characterized and predicted non-random access memory data to be compressed and random access memory data that remains uncompressed in a memory compression apparatus.
[0094] Predicted random access pages should be in uncompressed form. It is preferred to bypass these pages without looking up their metadata each time there is a memory transaction targeting the bypassed memory data. This is because looking up would break the ATT and defeat the purpose of selectively compressing memory data that could benefit from compression.
[0095] To achieve efficient bypassing, we need a new layer of metadata that stores as little information as possible about the memory data, i.e., whether it is compressed or bypassed. The data granularity used to store this new metadata information determines the amount of metadata.
[0096] In an exemplary embodiment, the granularity can be set to the same granularity as used by the characterization and prediction apparatus and method for characterizing non-random access and random access memory data; for example, it can be set to the granularity of a memory page. One bit of data per page is sufficient to distinguish non-random access memory data from random access memory data.
[0097] Storing 1 bit of metadata for each memory page in the memory controller to which the memory compression device is connected will still result in multiple bits, because if the memory capacity is large, there are multiple memory pages in the memory controller; the area resources inside the memory compression device for storing this information may not be sufficient. For example, for a 4GB memory connected to the memory controller, assuming a page size of 4KB, the size of the metadata will be 122KB (1M metadata bits). Therefore, an exemplary 1-bit metadata per page (called a bitmap for storing bypass status / compression status) is stored in the main memory.
[0098] Fig.14Metadata layout 1400 is depicted. Bitmap metadata 1490 is allocated in memory address space 1420 along with ATT metadata 1480. This metadata is essentially a plurality of bit sequences, so it exists in a form similar to the pure data being compressed by the memory compression device. It is worth noting that compressed data 1440 will contain a mix of compressed page data and uncompressed page data. A portion of the bitmap metadata 1490 may be further cached in the memory compression device.
[0099] Fig.15 An exemplary embodiment of a bitmap cache device 1500 for caching bitmap metadata is depicted. The bitmap cache device includes a tag array 1530 and a data array 1560, wherein each bitmap cache entry includes one or more compression / bypass metadata cells, wherein each compression / bypass metadata cell corresponds to a memory page. In this exemplary embodiment, the compression / bypass metadata cell is a single (1) bit.
[0100] Fig.16 An exemplary implementation of a bitmap cache access method 1600 is depicted. A bitmap cache request 1605 is processed as follows: First, the metadata address of the requested data request is calculated at 1610, and the metadata address is used to look up the bitmap cache tag array (reference 1620). Fig.15 This lookup may hit, which means that the metadata is in the bitmap cache and the data array can be retrieved from the bitmap cache at 1630 (refer to Fig.15 The memory array 1600 may be used to read the bitmap cache data array and the corresponding tag array 1660. At the same time, a response to the request that resulted in a bitmap cache miss may be generated at 1670. If the lookup at 1620 results in a miss, a request must be made to memory at 1640 to extract the requested bitmap data. Once the request is completed at 1650, the newly extracted data is inserted into the bitmap cache data array and the corresponding tag array at 1660. At the same time, a response to the request that resulted in a bitmap cache miss may be generated at 1670.
[0101] An alternative embodiment of the memory compression device may organize the bitmap metadata not by page but by region, where a region is defined as a plurality of memory pages. Using the previous example, i.e., 4GB of memory and a memory region of 64KB (or 16×4KB pages) connected to a memory controller, the size of the bitmap metadata is determined to be only 8KB (65536 regions, 1 bit per region). In this exemplary embodiment, the decision to compress or bypass an entire memory region requires homogeneous prediction of all pages in the region, i.e., all pages are characterized as compressed or bypassed. In an alternative embodiment, the prediction device and method may decide whether to compress or bypass the region based on the majority of pages in the region, i.e., if the predicted pages after compression are more than the bypassed pages, the entire region is compressed, and if the bypassed pages are more than the predicted pages after compression, the entire region is bypassed. Alternative embodiments may be implemented by those skilled in the art.
[0102] In yet another embodiment, the bitmap metadata may be organized hierarchically. This embodiment associates the bitmap metadata by region, and for each of the regions, the bitmap metadata is associated by page. In this embodiment, the cached metadata may be similarly organized in a bitmap cache hierarchy, wherein the top-level bitmap cache caches region-based bitmap metadata, and the second-level bitmap cache caches page-based bitmap metadata. This may be beneficial if there is a balanced mix of compressed and uncompressed pages. Therefore, the region is marked as compressed. Whether the page is compressed is indicated by the second-level page bitmap metadata. On the other hand, if the region is marked as uncompressed, all page data in the region is uncompressed. This does not require further checking of the page bitmap metadata.
[0103] Complete Device / System Implementation - Bypass
[0104] Fig.17 An exemplary embodiment of a device 1700 for accessing compressed computer memory (hereinafter referred to as memory compression device 1700) is shown. The memory compression device 1700 is based on Figure 5 1700 and is extended with the inventive structure and functionality described above with reference to the previous figures. Thus, the memory compression device 1700 includes a bitmap cache unit 1710 (e.g., Fig.15 and Fig.16 ), a representation unit 1730 for compressing pages (e.g., by Figures 10 to 13 ), a representation unit 1720 for uncompressed pages (e.g., by Figures 7 to 9 Any of the exemplary embodiments of the apparatus and method of the present invention is implemented) and the prediction unit 1740 (for example, the above-mentioned Figure 8 any exemplary implementation described in the paragraph following the description of ).
[0105] In the exemplary memory compression apparatus 1700, memory blocks that fall into bypassed pages (or regions) are selected to not go through the same path as compressed memory blocks, but are instead processed through the bypass request queue 1750. This has a dual benefit. The bypassed pages do not incur additional latency from accessing the pre-fetch buffer PB 1769 and ATT 1780, and can be sent immediately to the main memory 1790. Similarly, data responses for bypassed memory data can be provided immediately to the requester without passing through the decompressor unit 1765. Otherwise, data responses for compressed data would be provided as previously described. (Note that Fig.17 1769 to avoid illustrating too much detail.) In addition, PB 1769 and ATT 1780 are not contaminated by data and metadata corresponding to uncompressed memory data. By directing all read / write traffic for uncompressed memory data through the same path, even if this is unrelated to the compression path, this method is not subject to any memory consistency issues as long as the memory access granularity does not exceed the bypass granularity (4KB page in this exemplary embodiment). In alternative embodiments, those skilled in the art can modify this granularity to adapt to the target computer system by modifying the bitmap metadata granularity accordingly and the possible granularity adopted for characterization and prediction.
[0106] exist Fig.17 In the exemplary embodiment of FIG. 1705 , when a request 1705 arrives, the bitmap cache unit 1710 determines whether it belongs to (i.e., points to) a compressed page or a bypassed page. When the request belongs to a compressed page, it will pass through the compression control and data path of the memory compression device, which is similar to Figure 5 When the request belongs to an uncompressed page, it will be sent directly to the memory 1790 by bypassing the request queue 1750.
[0107] The blocks of uncompressed pages are located at their original addresses in memory 1790. Therefore, both read and write transactions to these blocks can be sent directly to memory 1790 without looking up any metadata (other than the lookup in the bitmap cache unit 1710 that occurred in the previous step). Read and write transactions are sent to memory in the same order as they arrived through the bypass request queue 1750 to ensure data consistency.
[0108] The representation unit 1730 for compressed pages analyzes the compressed pages for their spatiotemporal locality representation so that the predictor unit 1740 can evaluate the results of the representation unit 1730 to detect any random access pages that must be decompressed and bypassed. On the other hand, the bypassed pages are analyzed by the BP representation means 1720. The predictor means 1740 evaluates the said representation results of 1720 with the purpose of detecting non-random access pages that are correspondingly compressed.
[0109] When a random access page is detected, it is decompressed and the bitmap cache unit 1710 is updated accordingly (decision 1744). When a non-random access page is detected, it is marked as compressed in the bitmap cache unit 1710 (decision 1744) and compressed.
[0110] Compressed page read path 1760, compressed page write path 1770, ATT 1780 and memory 1790 and Figure 5 The compressed page reading path, compressed page writing path, ATT and memory of the memory compression device are similar.
[0111] Compression / decompression conversion
[0112] The apparatus and method described in the present disclosure characterize the spatiotemporal locality of memory data based on the access pattern of the memory data, predict whether the memory data should be compressed, decompressed, or remain compressed / uncompressed, and the marking of the state is managed by the bitmap apparatus / method. Fig.17 When making prediction / decision 1744 in FIG. 1 , there are multiple alternatives for handling this state change of the affected memory data.
[0113] In one embodiment, the transition from one state (e.g., an uncompressed state) to another state (e.g., a compressed state) is accomplished gradually or in a timely manner, i.e., when there is a memory write transaction that accesses all or part of the converted memory data, only the portion of the memory block accessed by the write transaction changes state.
[0114] In an alternative embodiment, the transition from one state to another is performed by fetching data from memory ( Fig.17 1790) reads the entire memory data to be completed eagerly. If the affected (affected by the aforementioned decision 1744) memory data is compressed, it must be decompressed by the decompressor unit 1765 and written back to the memory 1790. On the contrary, if the affected (affected by the aforementioned decision 1744) memory data is uncompressed, it must be compressed by the compressor unit 1775 and written back to the memory 1790.
[0115] In another alternative embodiment, the affected memory data may change state in a timely or eager manner according to a selected policy or other condition. For example, when memory bandwidth is overused, a timely state transition is more advantageous because no additional traffic overhead is imposed. On the other hand, an eager transition may be preferred so that the state of the affected memory data changes immediately to reduce overhead as quickly as possible (if the prediction is to bypass the page) or to increase revenue as quickly as possible (if the prediction is to compress the page).
[0116] Conclusion - General Aspects of the Disclosed Invention
[0117] As mentioned at the beginning of the detailed description, Fig.18 and Fig.19 The general aspects of the present invention can be understood in Fig.18 Depicted is a method 1800 for managing compressible computer memory, Fig.19 An apparatus 1900 for managing compressible computer memory is depicted.
[0118] Fig.18 The method 1800 is used to manage a compressible computer memory, for example, the compressible computer memory is Fig.17 Memory 1790 or Figure 1 Memory modules 151 to 153 in. Fig.17 The memory 1790 in will now be used as a non-limiting example of computer memory. As shown in 1810, the method 1800 includes monitoring memory requests for the computer memory 1790 (reference Fig.17 1705) to classify memory regions based on the spatiotemporal locality of memory requests made to the memory regions, wherein when the frequency of memory requests to the memory region is below a threshold, the memory region is classified as exhibiting low spatiotemporal locality. Those skilled in the art will appreciate that, depending on implementation considerations, the threshold may define the maximum number of memory requests to the memory region (or more specifically, to any memory content belonging to the memory region) within a given time period such that the memory region is classified as exhibiting low spatiotemporal locality. In other words, if the number of memory requests to the memory region within the given time period exceeds the value, the memory region is not classified as exhibiting low spatiotemporal locality. The threshold may be a static value or a dynamic value. Similarly, the time period may be statically defined (i.e., predefined) or dynamic. This also applies to Fig.19 Device 1900 in.
[0119] As seen at 1820, method 1800 also includes selectively managing compressible computer memory based on the classification such that memory contents of memory regions classified as exhibiting low spatiotemporal locality are stored in uncompressed form in computer memory 1790 (see Fig.18 1830 in the computer memory), and the memory contents of the memory regions that are not classified as exhibiting low spatiotemporal locality are stored in a compressed form in the computer memory 1790 (reference Fig.18 in 1840).
[0120] Fig.19 The device 1900 for managing the compressible computer memory 1990 has a memory area classification device 1901, which is configured to monitor the computer memory 1990 (reference Fig.17 1790) memory request (reference Fig.17 1705 in the example, and classifying the memory regions based on the temporal and spatial locality of the memory requests made to the memory regions, wherein when the frequency of the memory requests to the memory regions is below a threshold, the memory regions are classified as exhibiting low temporal and spatial locality. The apparatus 1900 also has a selective computer memory management apparatus 1902, which is operably connected to the memory region classification apparatus 1901. The selective computer memory management apparatus 1902 includes a bypass type memory access mechanism 1903 and a compression type memory access mechanism 1904.
[0121] The bypass type memory access mechanism 1903 may include, for example, Fig.17 The bypass request queue 1750 in the computer memory 1990 may be implemented by or correspond to the bypass request queue 1750. The bypass type memory access mechanism 1903 is configured to: process the memory contents of the memory area classified as exhibiting low temporal and spatial locality in an uncompressed form in the computer memory 1990 (refer to Fig.19 in 1906).
[0122] The compressed memory access mechanism 1904 may include, for example, Fig.17 The read path 1760, write path 1770 and address translation table 1780 in the computer memory 1990 are implemented by or correspond to the read path 1760, write path 1770 and address translation table 1780 in the computer memory 1990. The compressed memory access mechanism 1904 is configured to: process the memory contents of the memory areas that are not classified as exhibiting low temporal and spatial locality in a compressed form in the computer memory 1990 (refer to Fig.19 in 1907).
[0123] As can be clearly seen from the foregoing detailed description, each memory region generally constitutes a memory page in a computer memory (or alternatively, a series of consecutive memory pages in a computer memory, depending on the implementation). Each memory page contains a number of memory blocks. The compressed memory contents can be retrieved from the computer memory as a compressed package, which consists of a number of compressed consecutive memory blocks, which are compacted into a physical memory block. When the number of memory requests for memory blocks belonging to or to belong to the same compressed package is below a threshold, the memory region is generally considered to exhibit low spatiotemporal locality. In the foregoing description, such a memory region is referred to as a "random access page".
[0124] Alternatively, when a first memory request to a memory block in a memory area is not followed by a second memory request to a second memory block belonging to or to belong to the same compressed package within a monitored time period, the memory area will generally be considered to exhibit low spatiotemporal locality. It can be clearly seen from the above that retrieval of compressed memory content generally includes using an address translation table ATT 1780 to map the physical (uncompressed) location of the memory content of a memory area in a computer memory to the compressed location of the memory content of a memory area in a computer memory. Typically, the monitored time period is a time window from extracting the address translation metadata of a memory area into an address translation table until the address translation metadata is ejected from the address translation table. Advantageously, the monitored time period may also include one or more historical time windows from extracting the address translation metadata of a memory area to ejecting the address translation metadata of a memory area.
[0125] Fig.19 The device 1900 in the embodiment may further include a classification processing device (refer to Fig.17 1710 in the example, the classification processing device is configured to: receive a memory request 1705 involving a specific memory area; determine the classification of the specific memory area; and selectively process the received memory request 1705 in the following manner according to the determined classification. When the determined classification of the specific memory area is not low spatiotemporal locality (i.e., the specific memory area is not a random access page), by calling a compressed memory access mechanism 1904 (e.g., Fig.17 Units 1760 to 1780 in the computer memory 1990 (1790) retrieve 1907 the requested compressed memory content to receive the received memory request 1705 as a compressed memory request (reference Fig.17On the other hand, when the classification of the determined specific memory area is low in temporal and spatial locality (i.e., the specific memory area is a random access page), by calling the bypass type memory access mechanism 1903 (e.g., Fig.17 1750 in the example of FIG. 1700 ) to bypass the compressed memory access mechanism 1904 (1760 to 1780) and retrieve 1906 the requested memory contents in uncompressed form directly from the computer memory 1990 (1790) to treat the received memory request 1705 as an uncompressed memory request (reference Fig.17 1714) for processing.
[0126] Advantageously, the compressed memory access mechanism 1904 (1760 to 1780) further includes a pre-fetch buffer (see Fig.17 1769 in ), and the compressed memory access mechanism is configured to: by checking (reference Figure 6 610) to process the compressed memory request 1716. If the requested memory content is present in the pre-fetch buffer 1769 in decompressed form, the mechanism 1904 will respond to the received memory request 1705 using the decompressed memory content from the pre-fetch buffer 1769 (see Figure 6 630 in ). If the requested memory content is not present in the pre-fetch buffer 1769 in decompressed form, the mechanism 1904 will convert the memory content from the address translation table (reference Fig.17 1780 in ) to retrieve the metadata required to retrieve the requested storage content (reference Figure 6 650 and 670 in Fig.17 1768 and 1782 in the address translation table), or if not available in the address translation table, the metadata required to retrieve the requested memory contents is retrieved from the computer memory 1990 (1790) (reference Figure 6 650 and 670 in Fig.17 1768 and 1782); then retrieve from computer memory 1990 (1790) using the retrieved metadata (reference Figure 6 690 and Fig.17 1775) in compressed form (reference Fig.17 1764 in ); decompress the retrieved memory contents (reference Fig.17 1765 in ); and finally using the decompressed memory contents (reference Fig.17 1762 in) responds to the received memory request 1705 (reference Figure 6630 in ).
[0127] As mentioned above Fig.17 As described in the embodiment of FIG. 1 , the classification processing device 1710 may be a bitmap cache unit, which includes an indication for maintaining the classification of each storage area (see Fig.15 1595) data structure (reference Fig.15 The classification processing means 1710 is configured to determine the classification of a specific storage area by examining the indication 1595 for the specific storage area in the data structures 1560, 1590.
[0128] The apparatus 1900 may further include a representation unit for compressing the page (see Fig.17 The unit 1730 in the compressed page representation unit is configured to monitor a memory region that is not currently classified as having low spatial and temporal locality in order to potentially reclassify the memory region as having low spatial and temporal locality. Therefore, the unit 1730 for compressing pages can be operated to maintain a data structure (reference Fig.17 ), which data structure includes a shadow tag array (refer to Fig. 9 940 and Figure 7 730), each entry in the shadow tag array (reference Fig. 9 980 in the memory area) represents a compressed packet of several consecutive memory blocks in the memory area. The characterization unit 1730 for compressed pages will also be operable to maintain an address translation table (reference Figure 7 700 in ), the address translation table includes a metadata array (reference Figure 7 760), each entry in the metadata array (reference Figure 7 790 in ) represents a memory area and includes at least one counter (reference Figure 7 796 in the shadow tag array 940, 730), the at least one counter indicating the number of times a memory request has been directed to the memory block represented in the shadow tag array 940, 730. The characterization unit 1730 for compressed pages will also be operable to analyze the at least one counter 796 after eviction from the address translation table 700 to determine whether the memory region should be reclassified as low temporal and spatial locality. In practice, this means reclassifying from a non-random access page to a random access page.
[0129] To this end, each entry 790 in the metadata array 760 may advantageously include a current counter 798 for a current presence in the address translation table 700 and a history counter for a past presence in the address translation table 700. Thus, the characterization unit 1730 for compressed pages may be configured to determine whether a memory region should be reclassified as having low spatiotemporal locality by averaging the current counter and the history counter and comparing the average to thresholds or high and low watermarks.
[0130] The apparatus 1900 may also include a representation unit for uncompressed pages (see Fig.17 The unit 1720 in the representation unit for uncompressed pages is configured to monitor a memory region currently classified as low spatial and temporal locality in order to potentially reclassify the memory region as non-low spatial and temporal locality. Therefore, the representation unit 1720 for uncompressed pages will be operable to maintain a first data structure (reference Fig.10 and Fig.17 1040, BP-ST, 1726 in the first data structure, the first data structure includes a shadow tag array, each entry in the shadow tag array represents a number of consecutive memory blocks in the memory area, as if they have been compressed and contained in a compressed package. The representation unit 1720 for uncompressed pages will also be operable to maintain a second data structure (refer to the aforementioned 1080, BP-ATT, 1300, 1728), the second data structure simulates an address translation table and includes a metadata array (refer to Fig.13 1360), each entry in the metadata array (reference Fig.13 1390 in ) represents a memory area and includes at least one counter (reference Fig.13 1396), wherein at least one counter indicates the number of times a memory request is directed to a memory block represented in the shadow tag array.
[0131] The characterization unit 1720 for uncompressed pages will also be operable to analyze the at least one counter 1396 to determine whether the memory region should be reclassified as not having low spatiotemporal locality after being evicted from the second data structure 1080, BP-ATT, 1300, 1728. In practice, this means reclassifying from a random access page to a non-random access page.
[0132] Each entry 1390 in the metadata array 1360 may advantageously include a current counter 1398 for a current existence in the second data structure 1080, BP-ATT, 1300, 1728 and a history counter for a past existence in the second data structure 1080, BP-ATT, 1300, 1728. Thus, the characterization unit 1720 for uncompressed pages may be configured to determine whether a memory region should be reclassified as not having low spatiotemporal locality by averaging the current counter and the history counter and comparing the average to a threshold or high and low watermark.
[0133] The method 1800 may generally include the same functions performed by the structural elements of the apparatus 1900 described above.
[0134] The apparatus 1900 may include a device configured to perform in any of its embodiments Fig.18 Another device of the logic circuit of the method can be configured to be connected to a computer system (e.g. Figure 1 100) of a memory controller (e.g. Figure 1 141) and cache memory (e.g. Figure 1 Alternatively, such a device may be included in or implemented by a memory controller of a computer system.
[0135] The present invention may be embodied in a computer system (e.g. Figure 1 100), the computer system includes one or more processors (e.g. Figure 1 P1-P N ), compressible main memory (e.g. Figure 1 M1-M K ), and for receiving from said one or more processors P1-P N For compressible main memory M1-M K Device 1900 for processing a memory request.
[0136] Another aspect of the invention is a method of managing a compressible computer memory, the method comprising: monitoring memory requests to the computer memory to classify memory regions based on the spatiotemporal locality of memory requests made to the memory regions; and selectively managing the compressible computer memory based on the classification so that the memory contents of memory regions classified as exhibiting low spatiotemporal locality are stored in the computer memory in uncompressed form, while the memory contents of memory regions not classified as exhibiting low spatiotemporal locality are stored in the computer memory in compressed form. The method may have any or all of the features of the attached dependent claims 2 to 12. An apparatus comprising logic circuitry may be configured to perform the method according to this alternative aspect.
Claims
1. A method (1800) for managing compressible computer memory (1790), the method comprising: monitoring (1810) memory requests (1705) to the computer memory (1790) to classify memory regions based on spatiotemporal locality of the memory requests made to the memory regions, wherein when a frequency of memory requests to a memory region is below a threshold, the memory region is classified as exhibiting low spatiotemporal locality; and The compressible computer memory is selectively managed (1820) based on the classification such that memory contents of memory regions classified as exhibiting low spatiotemporal locality are stored in uncompressed form (1830) in the computer memory, while memory contents of memory regions not classified as exhibiting low spatiotemporal locality are stored in compressed form (1840) in the computer memory.
2. The method according to claim 1, each memory region constituting a memory page in the computer memory, or each memory region constituting a series of consecutive memory pages in the computer memory, each memory page comprising a number of memory blocks, the compressed memory content being retrievable from the computer memory as a compressed package, the compressed package comprising a number of compressed consecutive memory blocks, the number of compressed consecutive memory blocks being compacted into one physical memory block, in, When the number of memory requests for memory blocks that belong or will belong to the same compressed packet is below a threshold, the memory region exhibits low spatiotemporal locality.
3. The method of claim 1 , wherein each memory region constitutes a memory page in the computer memory or each memory region constitutes a series of consecutive memory pages in the computer memory, each memory page comprising a number of memory blocks, the compressed memory content being retrievable from the computer memory as a compressed package, the compressed package comprising a number of compressed consecutive memory blocks, the number of compressed consecutive memory blocks being compacted into one physical memory block, in, A memory region exhibits low spatiotemporal locality when a first memory request for a memory block in the memory region is not followed by a second memory request for a second memory block that belongs or will belong to the same compressed packet within a monitored time period.
4. The method according to claim 3, wherein: Retrieval of the compressed memory contents includes using an address translation table (ATT, 1780) to map a physical (uncompressed) location of the memory contents of the memory region in the computer memory to a compressed location of the memory contents of the memory region in the computer memory, and wherein the monitored time period is a time window from extracting address translation metadata of the memory region into the address translation table until the address translation metadata is evicted from the address translation table.
5. The method according to claim 4, wherein: The monitored time period also includes one or more historical time windows from extracting the address translation metadata of the memory region to evicting the address translation metadata of the memory region.
6. The method according to any preceding claim, further comprising: receiving a memory request involving a particular memory region (1705); determining a classification of the specific memory area; The received memory request (1705) is selectively processed according to the determined classification in the following manner: When the determined classification of the particular memory region is not low spatiotemporal locality, processing the received memory request (1705) as a compressed memory request (1716) by invoking a compressed memory access mechanism (1760-1780) having functionality to retrieve compressed memory contents from the computer memory (1790); as well as When the classification of the specific memory region is determined to be low spatiotemporal locality When the compressed memory access mechanism (1760-1780) is bypassed, the received memory request (1705) is processed as an uncompressed memory request (1714) by directly retrieving the requested memory contents in uncompressed form from the computer memory (1790).
7. The method according to claim 6, wherein: Processing the memory request (1705) as a compressed memory request (1716) by invoking the compressed memory access mechanism (1760-1780) includes: checking (610) whether the requested memory content is present in the prefetch buffer (1769) in decompressed form; In the case where the requested memory content is present in the prefetch buffer (1769) in decompressed form: responding (630) to a received memory request (1705) using decompressed memory contents from the pre-fetch buffer (1769); In the event that the requested memory content is not present in the prefetch buffer (1769) in decompressed form: retrieving (650, 670, 1768, 1782) metadata required to retrieve the requested memory contents from an address translation table (1780) or, if not available in the address translation table (1780), retrieving metadata required to retrieve the requested memory contents from the computer memory (1790); retrieving (690, 1775) the requested memory content (1764) in compressed form from the computer memory (1790) using the retrieved metadata; decompressing the retrieved memory contents (1765); and The received memory request (1705) is responded to (630) using the decompressed memory contents (1762).
8. The method of claim 6 or 7, further comprising maintaining a data structure (1560, 1590) including an indication (1595) of the classification of each memory region, wherein Determining the classification of the particular memory region includes examining the data structure (1560, 1590) for an indication (1595) of the particular memory region.
9. A method according to any preceding claim, further comprising monitoring a memory region not currently classified as having low spatiotemporal locality in order to potentially reclassify the memory region as having low spatiotemporal locality by: maintaining a data structure (ST, 1735), the data structure (ST, 1735) comprising a shadow tag array (940, 730), each entry (980) in the shadow tag array representing a compressed package of a number of contiguous memory blocks in a memory region, maintaining an address translation table (700), the address translation table (700) comprising a metadata array (760), each entry (790) in the metadata array representing a memory region and comprising at least one counter (796), the at least one counter (796) indicating a number of times a memory request has been directed to a memory block represented in the shadow tag array (940, 730); and After being evicted from the address translation table (700), the at least one counter (796) is analyzed to determine whether the memory region should be reclassified as having low spatiotemporal locality.
10. The method according to claim 9, wherein: Each entry (790) in the metadata array (760) includes a current counter (798) currently existing in the address translation table (700) and a historical counter for a past existence in the address translation table (700), and wherein the determination of whether the memory region should be reclassified as having low spatiotemporal locality includes averaging the current counter and the historical counter and comparing the average to a threshold or a high water mark and a low water mark.
11. A method according to any preceding claim, further comprising monitoring a memory region currently classified as having low spatiotemporal locality to potentially reclassify the memory region as not having low spatiotemporal locality by: maintaining a first data structure (1040, BP-ST, 1726), the first data structure (1040, BP-ST, 1726) comprising a shadow tag array, each entry in the shadow tag array representing a number of consecutive memory blocks of a memory region, as if the number of consecutive memory blocks had been compressed and contained in a compressed packet, maintaining a second data structure (1080, BP-ATT, 1300, 1728) emulating an address translation table and comprising a metadata array (1360), each entry (1390) in the metadata array representing a memory region and comprising at least one counter (1396), the at least one counter (1396) indicating a number of times a memory request has been directed to a memory block represented in the shadow tag array; and Upon eviction from the second data structure (1080, BP-ATT, 1300, 1728), the at least one counter (1396) is analyzed to determine whether the memory region should be reclassified as non-low spatiotemporal locality.
12. The method according to claim 10, wherein: Each entry (1390) in the metadata array (1360) includes a current counter (1398) currently existing in the second data structure (1080, BP-ATT, 1300, 1728) and a historical counter that existed in the past in the second data structure (1080, BP-ATT, 1300, 1728), wherein the determination of whether the memory area should be reclassified as non-low spatiotemporal locality includes: averaging the current counter and the historical counter and comparing the average to a threshold or a high water mark and a low water mark.
13. An apparatus comprising logic circuitry configured to perform the method according to any one of claims 1 to 12.
14. The apparatus according to claim 13, the apparatus being configured to be connected between a memory controller (141) and a cache memory (120) of a computer system (100).
15. The apparatus according to claim 13, the apparatus being included in a memory controller (141) of a computer system (100) or being implemented by the memory controller (141) of the computer system (100).
16. An apparatus (1700, 1900) for managing a compressible computer memory (1790, 1990), the apparatus comprising: a memory region classification device (1901) configured to: monitor memory requests (1705) to the computer memory (1790, 1990) and classify memory regions based on spatiotemporal locality of the memory requests made to the memory regions, wherein when the frequency of memory requests to the memory regions is below a threshold, the memory regions are classified as exhibiting low spatiotemporal locality; and A selective computer memory management device (1902), the selective computer memory management device (1902) is operably connected to the memory area classification device (1901), and the selective computer memory management device (1902) includes a bypass type memory access mechanism (1750, 1903) and a compression type memory access mechanism (1760-1780, 1904), wherein: The bypass-type memory access mechanism (1750, 1903) is configured to process (1906) memory contents of memory regions classified as exhibiting low spatiotemporal locality in the computer memory (1790, 1990) in uncompressed form, and The compressed memory access mechanism (1760-1780, 1904) is configured to process (1907) memory contents of memory regions that are not classified as exhibiting low spatiotemporal locality in the computer memory (1790, 1990) in a compressed form.
17. The apparatus of claim 16, wherein each memory region constitutes a memory page in the computer memory, or each memory region constitutes a series of consecutive memory pages in the computer memory, each memory page comprising a number of memory blocks, the compressed memory content being retrievable from the computer memory as a compressed package, the compressed package comprising a number of compressed consecutive memory blocks, the number of compressed consecutive memory blocks being compacted into one physical memory block, wherein When the number of memory requests for memory blocks that belong or will belong to the same compressed packet is below a threshold, the memory region exhibits low spatiotemporal locality.
18. The device according to claim 17, wherein: Retrieval of compressed memory contents includes using an address translation table (ATT, 1780) to map a physical (uncompressed) location of memory contents of a memory region in the computer memory to a compressed location of memory contents of the memory region in the computer memory, and wherein the monitored time period is a time window from extracting address translation metadata of the memory region into the address translation table until the address translation metadata is evicted from the address translation table.
19. The device according to claim 18, wherein: The monitored time period also includes one or more historical time windows from extracting the address translation metadata of the memory region to evicting the address translation metadata of the memory region.
20. The apparatus according to any one of claims 16 to 19, further comprising a classification processing device (1710), the classification processing device (1710) being configured to: receive a memory request (1705) involving a specific memory area; determine a classification of the specific memory area; and selectively process the received memory request (1705) in the following manner according to the determined classification: When the determined classification of the particular memory region is not low spatiotemporal locality, processing the received memory request (1705) as a compressed memory request (1716) by invoking the compressed memory access mechanism (1760-1780, 1904) to retrieve the requested compressed memory contents from the computer memory (1790, 1990); and When the classification of the specific memory region is determined to be low spatiotemporal locality When the received memory request (1705) is processed as an uncompressed memory request (1714) by calling the bypass memory access mechanism (1750, 1903) to bypass the compressed memory access mechanism (1760-1780, 1904) and directly retrieve the requested memory contents in uncompressed form from the computer memory (1790).
21. The device according to claim 20, wherein: The compressed memory access mechanism (1760-1780, 1904) further includes a pre-fetch buffer (1769), and the compressed memory access mechanism (1760-1780, 1904) is configured to process the compressed memory request (1716) in the following manner: checking (610) whether the requested memory content is present in the prefetch buffer (1769) in decompressed form; In the case where the requested memory content is present in the prefetch buffer (1769) in decompressed form: responding (630) to a received memory request (1705) using decompressed memory contents from the pre-fetch buffer (1769); In the event that the requested memory content is not present in the prefetch buffer (1769) in decompressed form: retrieving (650, 670, 1768, 1782) metadata required to retrieve the requested memory contents from an address translation table (1780) or, if not available in the address translation table (1780), retrieving metadata required to retrieve the requested memory contents from the computer memory (1790, 1990); retrieving (690, 1775) the requested memory content in a compressed form (1764) from said computer memory (1790, 1990) using the retrieved metadata; Decompress the retrieved memory contents (1765); as well as The received memory request (1705) is responded to (630) using the decompressed memory contents (1762).
22. The device according to claim 20 or 21, wherein: The classification processing device (1710) includes a data structure (1560, 1590) for maintaining an indication (1595) regarding the classification of each memory area, and wherein the classification processing device (1710) is configured to determine the classification of the specific memory area by examining the indication (1595) for the specific memory area in the data structure (1560, 1590).
23. The apparatus according to any one of claims 16 to 22, further comprising a characterization unit (1730) for compressing pages, the characterization unit (1730) for compressing pages being configured to monitor a memory region that is not currently classified as having low spatiotemporal locality in order to potentially reclassify the memory region as having low spatiotemporal locality by: maintaining a data structure (ST, 1735), the data structure (ST, 1735) comprising a shadow tag array (940, 730), each entry (980) in the shadow tag array representing a compressed package of a number of contiguous memory blocks in a memory region, maintaining an address translation table (700), the address translation table (700) comprising a metadata array (760), each entry (790) in the metadata array representing a memory region and comprising at least one counter (796), the at least one counter (796) indicating a number of times a memory request has been directed to a memory block represented in the shadow tag array (940, 730); and After being evicted from the address translation table (700), the at least one counter (796) is analyzed to determine whether the memory region should be reclassified as having low spatiotemporal locality.
24. The device according to claim 23, wherein: Each entry (790) in the metadata array (760) includes a current counter (798) currently existing in the address translation table (700) and a history counter for a past existence in the address translation table (700), and wherein the characterization unit (1730) for compressed pages is configured to determine whether the memory area should be reclassified as having low spatiotemporal locality by averaging the current counter and the history counter and comparing the average to a threshold or a high water mark and a low water mark.
25. The apparatus according to any one of claims 16 to 24, further comprising a characterization unit (1720) for uncompressed pages, the characterization unit (1720) for uncompressed pages being configured to monitor a memory region currently classified as having low spatiotemporal locality in order to potentially reclassify the memory region as having non-low spatiotemporal locality by: maintaining a first data structure (1040, BP-ST, 1726), the first data structure (1040, BP-ST, 1726) comprising a shadow tag array, each entry in the shadow tag array representing a number of consecutive memory blocks of a memory region, as if the number of consecutive memory blocks had been compressed and contained in a compressed packet, maintaining a second data structure (1080, BP-ATT, 1300, 1728) emulating an address translation table and comprising a metadata array (1360), each entry (1390) in the metadata array representing a memory region and comprising at least one counter (1396), the at least one counter (1396) indicating a number of times a memory request has been directed to a memory block represented in the shadow tag array; and Upon eviction from the second data structure (1080, BP-ATT, 1300, 1728), the at least one counter (1396) is analyzed to determine whether the memory region should be reclassified as non-low spatiotemporal locality.
26. The device according to claim 25, wherein Each entry (1390) in the metadata array (1360) includes a current counter (1398) currently existing in the second data structure (1080, BP-ATT, 1300, 1728) and a historical counter for a past existence in the second data structure (1080, BP-ATT, 1300, 1728), wherein the representation unit (1720) for uncompressed pages is configured to determine whether the memory area should be reclassified as non-low spatiotemporal locality by averaging the current counter and the historical counter and comparing the average to a threshold or a high water mark and a low water mark.
27. A computer system (100), the computer system (100) comprising: One or more processors (P1-P N ); Compressible main memory (M1-M K ); as well as The apparatus (1700, 1900) according to any one of claims 13 to 26, wherein the apparatus (1700, 1900) is configured to receive data from the one or more processors (P1-P2) and to receive data from the one or more processors (P1-P3). N ) of the compressible main memory (M1-M K )'s memory request to process.
