The present application is related to commonly-assigned United States utility patent applications “MEMORY COMPRESSION ARCHITECTURE FOR EMBEDDED SYSTEMS,” Ser. No. 10/869,985, now U.S. Pat. No. 7,302,543, and “MEMORY ENCRYPTION ARCHITECTURE,” Ser. No. 10/869,983, both filed contemporaneously with the present application and both of which are incorporated by reference herein.
The present invention is related to memory architectures and, more particularly, to architectures for compression and encryption of memory.
Compression and encryption techniques are well-known. A recent development has been to use techniques such as compression to reduce the size of main memory in a computer architecture. See, e.g., M. Kjelso et al., “Main Memory Hardware Data Compression,” 22nd Euromicro Conference, pages 423-30, IEEE Computer Society Press (September 1996). For example, researchers at IBM have developed the “MXT” architecture for servers which performs compression and decompression during runtime of an application when transferring data from the L3 cache to main memory and vice versa. See Tremaine et al., “IBM Memory Expansion Technolog (MXT),” IBM J. Res. & Dev., Vol. 45, No. 2 (March 2001). See also U.S. Pat. Nos. 5,761,536, 5,812,817, and 6,240,419, which are incorporated by reference herein. Similarly, encryption has been utilized in the prior art to protect sensitive code or data stored in memory.
Despite the advances in compression and encryption, prior art use of application compression and encryption techniques typically rely on the following constraints. First, compression/decompression and encryption/decryption is typically applied at a specific level of the memory hierarchy. Second, once that level of the memory hierarchy is pre-specified, a specific compression and/or encryption algorithm is selected, namely an algorithm that is suitable for that level of the memory hierarchy. Thus, solutions currently available will provide a compression or encryption scheme that may be optimal with regards to a portion of an application's code or data but that may be suboptimal with regards to much of the rest of the application code or data. This is particularly of concern in embedded systems, where space constraints and security issues typically exist.
Accordingly, there is a need for an architecture that can handle compression and encryption in a more flexible and efficient manner.
The present invention is directed to a methodology for compression/encryption that is content-aware. In accordance with an embodiment of the invention, compression/decompression and encryption/decryption are done in multiple locations within the various levels of a memory hierarchy. Applications are segmented into different areas that can be compressed and/or encrypted using different algorithms. Critical segments that must be executed fast can be left uncompressed while other segments which are less critical but which are highly compressible can be compressed. Sensitive data areas can be encrypted while other less sensitive areas can be left unencrypted for speed of execution. Different compression and/or encryption schemes can be used for the various segments to maximize compressibility and performance.
The present invention provides the flexibility to treat different regions of the application using different strategies and provides the ability to carry out such decisions dynamically during execution. These and other advantages of the invention will be apparent to those of ordinary skill in the art by reference to the following detailed description and the accompanying drawings.
It should be noted that the memory hierarchy depicted in
In accordance with an embodiment of an aspect of the invention, compression is integrated into the architecture shown in
In accordance with a preferred embodiment of the present invention, the executable application is segmented into a plurality of areas at step 201. A typical executable application, for example, can contain code and data segments. One simple technique of application segmentation can be achieved by separating code from data regions within the application. Handling these areas differently is useful as they have different statistical properties, and, more importantly, they are treated in a different manner during execution. Instruction code, for example, typically is not modified during execution (with the exception of self-modifying code, which is not often used) while data is often modified.
Thus, it is preferable to do a statistical analysis of the application prior to execution and to segment the application based on the statistical properties of the different areas of the application. This can result in code being separated from data or, as depicted in
The mechanisms described above are readily extendable to encryption. The application can be segmented into areas that must be protected since they have either sensitive data or code—and other areas that can be left unencrypted for speed of execution. For those segments that are to be encrypted, a suitable encryption scheme is selected, and the segment is encrypted using the selected encryption scheme.
As depicted in
At step 302, the compression of code/data that is requested too often can be moved “closer” to main memory. Given the typical overhead in using compression/encryption, it is generally beneficial to compress and decompress at levels of the memory hierarchy that are far away from the CPU. Thus, code that is executed very often can be designated to fall into a category of areas that are decompressed between main memory and the cache, rather than between the cache and the CPU. Fast execution of such code could warrant the increase in code size. Thus, with reference to
At step 303, existing code or data areas can be recompressed according to the new statistical information. For example, the statistical properties of data that changes can warrant a change in compression algorithm that more effectively deals with the nature of the data as it currently exists in memory. Thus, although run length encoding may effectively deal with initially empty data areas, as those same data areas fill up with live data during runtime, a shift in compression strategy could be advantageous to maximizing performance of the architecture.
At step 304, data that is never or infrequently requested can be recompressed using stronger compression algorithms to save memory space. The selection of compression algorithm often reflects a tradeoff between speed of execution and the amount of space that is saved through the use of compression. Where the segment of the application is infrequently accessed, the increase in memory savings may readily justify the decrease in execution speed from using a slower but more effective compression algorithm.
At step 305, the areas can be rearranged according to the frequency of access. Thus, the memory management system is content-aware and is able to adapt to the particular application being executed and learn during its execution so that both compression/encryption and performance are optimized as much as possible. The allocation of different portions of the application to particular compression approaches and to particular locations in the memory hierarchy, thus, need not be static. The different segments of the application can be rearranged and reallocated during runtime based on the appropriate performance metrics collected.
The above implementation is merely illustrative of the invention. It will be understood by those of ordinary skill in the art that various changes may be made that are within the scope of the invention, which is to be limited only by the appended claims.
Number | Name | Date | Kind |
---|---|---|---|
5057837 | Colwell et al. | Oct 1991 | A |
5386469 | Yearsley et al. | Jan 1995 | A |
5455576 | Clark, II et al. | Oct 1995 | A |
5654703 | Clark, II | Aug 1997 | A |
5761536 | Franaszek | Jun 1998 | A |
5764994 | Craft | Jun 1998 | A |
5812817 | Hovis et al. | Sep 1998 | A |
5825878 | Takahashi et al. | Oct 1998 | A |
5920723 | Peyton, Jr. et al. | Jul 1999 | A |
5999189 | Kajiya et al. | Dec 1999 | A |
6175896 | Bui | Jan 2001 | B1 |
6195743 | Elnozahy | Feb 2001 | B1 |
6202152 | Yuenyongsgool et al. | Mar 2001 | B1 |
6233674 | Elnozahy | May 2001 | B1 |
6240419 | Franaszek | May 2001 | B1 |
6330675 | Wiser et al. | Dec 2001 | B1 |
6442680 | Elnozahy | Aug 2002 | B1 |
6581131 | Vondran, Jr. | Jun 2003 | B2 |
6819271 | Geiger et al. | Nov 2004 | B2 |
6822589 | Dye et al. | Nov 2004 | B1 |
6865664 | Budrovic et al. | Mar 2005 | B2 |
Number | Date | Country | |
---|---|---|---|
20060002555 A1 | Jan 2006 | US |