Managing compressed memory using staggered interrupts

A staggered interrupt hierarchy with a machine check interrupt addresses memory management inefficiencies in compressed systems, optimizing memory usage and performance by ensuring timely memory availability and minimizing data loss.

DE112011103408B4Active Publication Date: 2024-12-05LENOVO ENTERPRISE SOLUTIONS (SINGAPORE) PTE LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
DE112011103408
Authority / Receiving Office
DE · DE
Patent Type
Patents
Current Assignee / Owner
Priority Date
2010-11-24
Filing Date
2011-09-23
Publication Date
2024-12-05
Estimated Expiration
2031-09-23

AI Technical Summary

Technical Problem

Memory compression systems face issues with real address space overload and inefficient management of physical memory, leading to storage space shortages and potential data loss due to delayed disk space release and underutilized memory.

Method used

A staggered interrupt hierarchy is implemented, utilizing a machine check interrupt to temporarily suspend all threads when memory is critically low, along with a tiered system of maskable and non-maskable interrupts to manage memory usage, ensuring timely availability of physical storage without unnecessary performance degradation.

Benefits of technology

This approach maximizes memory usage by minimizing the need for reserved free memory, reducing interrupts, and ensuring data integrity, thereby enhancing system performance and responsiveness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

Method for managing memory accessed by a first process executed by a processor, wherein a count value indicates a current utilization of the physical capacity of the memory and the method comprises: - Triggering an initial interrupt in response to the count exceeding an initial threshold, wherein the initial interrupt is a maskable interrupt that can be received by an interrupt handling unit which will subsequently attempt to generate available physical memory; - Triggering a second interrupt in response to the count exceeding a second threshold greater than the first threshold, the second interrupt being a non-maskable interrupt guaranteed to be received by the interrupt handling unit, which consequently attempts to generate available physical memory; and - Triggering a third interrupt in response to the count exceeding a third threshold greater than the second threshold, wherein the third interrupt is a machine check interrupt that suspends all activity on the processor and is received by a machine check handling unit which consequently attempts to generate available physical memory.
Need to check novelty before this filing date? Find Prior Art

Description

FIELD OF THE INVENTION

[0001] The present invention relates generally to computer memory architecture and, more particularly, to a system and method for managing compressed memory. BACKGROUND

[0002] Memory compression using encoded data can optimize the available memory volume. The encoded data can be represented as symbols that occupy less memory space. Memory compression expands memory capacity for specific applications without increasing the actual physical (working) memory (e.g., dynamic random access memory) and the associated overhead. In this way, a compressed memory system can provide an operating system and / or hypervisor with a larger real address space than is actually available. This can lead to the real address space (e.g., the available volume of physical memory reported to the operating system and / or hypervisor) becoming overloaded. In addition, the compression ratio may decrease, requiring more physical memory.The operating system or hypervisor can respond by deactivating real pages to free up physical memory space. The deactivated real pages can be copied to disk and freed to make room for the compressed data.

[0003] Occasionally, physical memory volume is not made available in a timely manner to prevent a shortage of memory space and the associated data loss. For example, processes required to free memory space may be delayed while the system continues to consume additional memory. Furthermore, processes not controlled by the operating system or hypervisor may continue to use available memory. Memory consumption may therefore occur faster than memory is freed. Larger amounts of free physical memory reserved as a precaution may result in underutilized memory. SUMMARY

[0004] It is an object of the present invention to enable improved memory management.

[0005] This problem is solved by the subject matter of main claim 1 and the subordinate claims 10 and 14.

[0006] Preferred embodiments of the present invention are the subject of the subclaims.

[0007] A method for managing memory according to the invention is provided by claim 1. A device according to the invention is provided by claim 10. A program product according to the invention is provided by claim 14. An embodiment can purposefully notify a hypervisor or an operating system that physical memory is running low, thereby largely preventing performance from declining to a minimum due to superfluous interrupts. A tiered interrupt hierarchy can purposefully utilize available memory capacity to its full extent. A machine check interrupt can minimize the amount of free physical memory that would otherwise be reserved for a possible delay in responding to an interrupt request.The hierarchical structure and machine-checking features can result in fewer interrupts and a larger usable physical memory volume. Using the machine-checking interrupt in conjunction with a highest memory priority can free up memory and minimize data loss. Additional usable physical memory volume can lead to improved system performance.

[0008] Features characterizing embodiments are set forth in the appended claims, which form a further part of this document. For a better understanding of the embodiments and the advantages and objectives achieved by their use, reference is made to the drawings and the accompanying description. BRIEF DESCRIPTION OF THE DRAWINGS Fig. 1 is a block diagram of one embodiment of a data processing system configured to manage compressed memory using a tiered hierarchy of interrupts associated with different levels of available memory; Fig. 2 is a block diagram illustrating in more detail the primary software components and resources used to implement a logically partitioned environment associated with the data processing system of Fig. 1 fits; Fig. 3 is a block diagram of one embodiment of a memory compression data processing system that uses interrupts triggered based on thresholds of used sector threshold registers to manage processes executing on processors connected to compressed memory; and Fig. 4 is a flowchart of one embodiment of a method for managing compressed memory that includes a tiered hierarchy of interrupts associated with different available memory levels to progressively impact memory-related processes. DETAILED DESCRIPTION

[0009] A particular embodiment of a compressed-memory computing system may employ a tiered hierarchy of interrupts that progressively impacts system operations based on detected levels of available memory. A machine check interrupt may be configured to temporarily suspend all threads on all cores of all processors of the computing system. The threads may be suspended instantaneously and controlled by a machine check dispatcher. The machine check interrupt may allow the threads to resume and return to the workload if a corrective action is successful.

[0010] The machine check handler may indicate to a hypervisor or operating system that existing swapping mechanisms should be used to create additional free physical storage volume that can accommodate an increasing amount of compressed data.

[0011] The machine check interrupt can only be used if one or more other interrupts have been ignored before the memory is exhausted. Because the machine check interrupt can interrupt all threads executing a workload, it has a comparatively greater impact on system performance than other interrupts, which can be configured to affect only a single thread, socket, or other process running on one or more processors. Using the machine check interrupt can guarantee that free memory is available before data is flushed. Consequently, less or no free memory needs to be reserved before generating an interrupt. The machine check interrupt can thus result in fewer interrupts and more available memory, which can enable higher system performance.

[0012] An embodiment of a memory controller may include a used sector register that maintains a running counter for the currently used physical memory. Two or more configurable memory usage thresholds may be stored in the used sector threshold registers. Each used sector threshold register may be software-configurable to trigger one of several interrupt types. Examples of specific interrupt types include a maskable interrupt, a non-maskable interrupt, and a machine check interrupt. Depending on the interrupt type and register configuration, each interrupt may be addressed to one or more processors in a data processing system.

[0013] The maskable interrupt can be configured to cause a thread, socket, or processor core to save its execution state and cause the interrupt handler to release available memory. Depending on the system configuration and concurrent processing requirements, the interrupt handler code can mask or delay processing of the maskable interrupt. The non-maskable interrupt can be non-maskable and ensure that software receives the non-maskable interrupt. The machine check interrupt can be used in conjunction with the above, less influential interrupts to halt all processor sockets, cores, and / or threads.Thus, the maskable, non-maskable, and machine check interrupts may comprise a tiered hierarchy of interrupts that progressively impacts system operations based on a detected level or amount of available memory. Memory capacity may be increased or decreased in response to a memory compression operation. For the purposes of this description, a memory compression operation may involve either a data compression or a data decompression procedure.

[0014] When the available memory capacity reaches an initial, non-critical value, the memory controller can trigger the maskable interrupt. When the interrupt handler in the hypervisor or operating system receives the maskable interrupt, it can attempt to create available physical memory. However, there is no guarantee that the maskable interrupt will not be masked or handled in time to obtain available memory. If the maskable interrupt is masked, not handled, or not received by the interrupt handler, the memory shortage can become more critical.

[0015] In response to detecting a second, more critical value of available memory, the memory controller can trigger the non-maskable interrupt. The non-maskable interrupt is guaranteed to be received by the interrupt handler. However, the interrupt handler may not be able to handle the non-maskable interrupt correctly. For example, a programming error in the interrupt handler, hypervisor, or operating system software could cause the creation of available memory to fail. Memory may also be exhausted when input / output (I / O) devices stream data into memory. Furthermore, data patterns may subsequently change, requiring more physical memory, making the system increasingly short of memory.If the system contains multiple processor sockets, multiple cores on each processor, and multiple threads on each processor core, all sockets, cores, and / or threads except the one receiving the interrupt may continue to consume more and more memory. For example, other threads may consume remaining memory before the interrupted thread frees more memory, resulting in data loss.

[0016] If the maskable interrupt fails to make more memory available and the memory reaches a third, critical level, the machine check interrupt may be triggered as the highest priority interrupt. The machine check interrupt may interrupt all activity (including, for example, I / O operations). The machine check handler may attempt to create free physical memory by invalidating rarely used memory pages and moving them to disk. Alternatively, or in addition, the machine check handler may write memory contents to secondary storage (second-level memory) such as flash memory or solid-state storage (SSD) to create additional free memory. Write operations to random access memory may not be allowed while the machine check handler attempts to create free space in the memory.

[0017] Secondary storage can accommodate overflow from overcommitted memory. Data removed from a physical storage location (e.g., a page) can be moved to secondary storage instead of to disk storage. As data compression ratios improve and more physical storage space becomes available, data can be moved from secondary storage back to physical memory. Using second-tier storage can thus achieve higher performance than moving data to and from disk storage.

[0018] Software code used to free physical memory space (e.g., the machine test processing unit) can be mapped to decompressed and uncompressed memory. Thus, retrieving the software code itself cannot lead to increased utilization and a shortage of physical memory in which the uncompressed code is stored for execution.

[0019] The used sector threshold registers can be used to trigger a maskable interrupt to the hypervisor or operating system in response to available memory approaching a desired threshold. Such a desired threshold may correspond to the amount of memory at which data can be relocated back to physical memory. Multiple thresholds in the used sector threshold register can be used to hierarchically communicate to the hypervisor or operating system that sufficient memory space is available. Alternatively, the hypervisor or operating system can poll the used sector threshold register to assess the amount of free memory and determine when more data can be relocated from disk to physical memory.

[0020] In addition to the used sector register, the memory controller may include software-configurable used sector threshold registers. The thresholds of the used sector threshold registers may be set by a system administrator. According to a particular embodiment, the memory controller may include four used sector threshold registers that may function as threshold levels. According to another embodiment, fewer or more used sector threshold registers may be included. A used sector threshold register may be used to determine when an exception is thrown and what type it is when the thresholds are exceeded. Each used sector threshold register may be configurable by software that writes to the register.A threshold and exception type can be written by software to each used sector threshold register. If the value of the used sector threshold register exceeds a certain value (threshold), the memory controller can throw an exception. For example, the memory controller can throw an exception if the value of the used sector register is less than or equal to a first used sector threshold register and then reaches a value greater than a first threshold.

[0021] Exceeding a second value of a used sector threshold register in an opposite direction can also trigger an exception associated with an interrupt. Interrupt types and thresholds can be specified based on the priority of the exception. Each used sector threshold register can trigger a different exception type available in the system. For example, software can configure a first used sector threshold register to trigger a regular unit interrupt or a maskable interrupt. The used sector threshold register can contain a low threshold. An administrator can configure a second used sector threshold register to trigger a non-maskable interrupt and contain a higher threshold.A third used sector threshold register can trigger a machine check interrupt and be associated with a highest threshold. The higher the thresholds are (approaching memory overflow), the higher the interrupt priority can be. The opposite can be true if the used sector register is decremented, exceeding a value in the used sector threshold register.

[0022] The machine check handler and operating system paging software that manages congested memory may run in an uncommitted region of memory. Uncommitted memory may contain memory space unaffected by physical memory congestion. A system may create and manage uncommitted memory by statically initializing memory configuration registers during system boot to separately define uncommitted and congested address space regions. Alternatively, or in addition, selected real memory regions may dynamically transition from congested to uncommitted regions and vice versa during operation. Native memory attached to processor sockets may be mapped so as not to be affected by congestion.A memory can create an uncompressed memory by configuring it to contain a constantly decompressed address space. By executing hypervisor and operating system code from uncompressed memory, the impact on critical memory can be minimized when the code is accessed.

[0023] In particular Fig. 1 illustrates a data processing device 100 configured to perform methods, according to one embodiment, that manage compressed memory using a tiered hierarchy of interrupts that increasingly impacts system operation based on a detected amount of available memory. A machine check interrupt may be configured to temporarily suspend all threads on all cores of all processors 102-104 of the device 100. The device 100 may generally represent any number of multi-user computer systems, such as network servers, mid-range computers, and mainframes, among others. However, embodiments may also be implemented in a different data processing device, e.g.,in stand-alone or single-user computer systems, such as workstations, desktop computers, portable computers, and the like, or in other data processing units such as integrated control units. One embodiment of device 100 may be a multi-user computer, such as the Power Systems computer available from International Business Machines Corporation (IBM).

[0024] Device 100 may include memory (e.g., memory 114, 117 to 119, 121) having compressed data. The memory storing the compressed data may provide a larger real address space to processors 102 to 104 and I / O devices than physical memory (e.g., dynamic random access memory). The real address space may be congested (e.g., by a factor of four). Occasionally, the data may change due to patterns that do not compress well. If data patterns change such that physical memory is almost completely consumed, a hypervisor or operating system may attempt to prevent the system from running out of physical space. For example, the least recently used pages may be identified as candidates for removal from disk.

[0025] According to one embodiment, memory compression logic may be enabled to notify the hypervisor or operating system that physical memory is running low, while simultaneously minimizing the performance impact of redundant interrupts. Unnecessary interrupts may not contribute to making more memory available and may waste CPU cycles. According to one embodiment, more usable physical memory may be made available by limiting the amount of free physical memory at which the operating system must be notified of the lack of free memory.This means that processing may not need to be interrupted as long as a significant amount of available physical memory remains, because the device's tiered hierarchy of interrupts (including the machine check interrupt) allows it to better respond to closely monitored memory thresholds. This feature can maximize memory utilization. The additional usable physical memory leads to higher system performance.

[0026] The physical processors 102 to 104 may be connected to an input / output (I / O) hub 116. A socket of one or more processors 102 to 104 may be directly and individually connected to a memory 118 to 119, e.g., to an array of DIMM (dual-row memory module) modules. The physical processors 102 to 104 may operate in multi-threaded mode. In multi-threaded mode, the physical processors 102 to 104 may simultaneously execute different portions of program code. The processors 102, 103 may exchange data with a memory controller 113 connected to an auxiliary memory 114. A buffer 115 and an auxiliary memory 121 may be connected to the processor 104.

[0027] The I / O distribution node 116 may further be connected to a number of types of external I / O devices via a system bus 118 and a plurality of interface devices. Specific I / O devices include a bus connection interface 120, a workstation control unit 122, and a storage control unit 124. Such I / O devices may each provide external access to one or more external networks 126, one or more workstations 128, and / or one or more storage devices, such as a direct access storage device (DASD) 129.

[0028] Fig. Figure 2 illustrates in detail the primary software components and resources used to implement a logically partitioned environment associated with the device 100 of Fig. 1 corresponds. Fig. Figure 2 generally shows a data processing architecture characterized by a virtual machine developed by IBM. System 200 includes a plurality of partitions 201 through 203 in which multiple processes share common processing resources. Such an architecture may be based on a single data processing machine with one or more central processing units (CPUs) 205, 206. CPUs 205, 206 may execute software configured to simulate multiple virtual processors 207 through 212.

[0029] Partitions 201 through 203 can logically contain a portion of the system's physical CPUs 205 and 206, DASD 268, and other resources allocated by an administrator. Each partition 201 through 203 typically houses an operating system 215 through 217, which includes virtual processors 207 through 212. Each partition 201 through 203 can act as a standalone computer. Fig. 2 shows that the data processing environment that each partition 201 to 203 has can also contain program code, such as the one shown in Fig. 2 shown applications 220 to 222.

[0030] An underlying program called hypervisor 246, or partition manager, can allocate physical resources to each partition 201 through 203. In virtualization technology, hypervisor 246 can manage operating systems 215 through 217 (or multiple instances of the same operating system) on a single computer system. Hypervisor 246 can manage the system's processor, memory, and other resources, and allocate resources to each operating system 215 through 217. For example, hypervisor 246 can intercept requests for resources from operating systems 215 through 217 and use and allocate the resources globally. If partitions 201 through 203 share processors, hypervisor 246 can allocate physical processor cycles to virtual processors 207 through 212 of partitions 201 through 203, which share one or more of CPUs 205 and 206.

[0031] The hypervisor 246 may include an uncompressed memory 232. The uncompressed memory 232 may include a continuously decompressed address space. By executing the hypervisor code from the uncompressed memory 232, the impact of fetching the code on critical memory may be minimized. An interrupt handler 233 may be included in the uncompressed memory 232. The interrupt handler 233 may include a callback subroutine whose execution is triggered by receiving an interrupt. For example, a specific subroutine may suspend a process of a thread, a socket, or a core and create additional available memory.

[0032] Machine check handler (MCK) code 234 may also be included within uncompressed memory 232. In response to receiving a machine check interrupt 238, the machine check handler 234 may take corrective action and continue executing the workload if the correction is successful. For example, the machine check handler 234 may request the hypervisor 246 or an operating system 215-217 to utilize existing swapping mechanisms to create additional free physical memory space to accommodate increasing amounts of compressed data. The machine check interrupt 238 may only be used if one or more other interrupts are ignored before the memory is completely exhausted.Because the machine check interrupt 238 can interrupt all threads executing a workload, it may have a comparatively greater performance impact than the maskable interrupt (INTR) 236 and the non-maskable interrupt (NMI) 237, which may be configured to affect only a single thread, socket, or processor. The machine check handler 234 may attempt to create free physical memory by deactivating rarely used memory pages and swapping them to disk. Alternatively or additionally, the machine check handler 234 may write memory contents to secondary memory. According to another embodiment, the uncommitted memory 232, the interrupt handler 233, and / or the machine check handler 234 may be included within an operating system.

[0033] Hypervisor 246 may include a memory mirroring algorithm 238 configured to map decompressed primary memory (which may be located, for example, in DIMM 248) to compressed mirrored memory (e.g., in DIMM 249). Using memory mirroring algorithm 238, CPU accesses can be redirected to the mirrored memory if a fault is detected in the primary memory. According to another embodiment, a memory mirroring program may be included within an operating system.

[0034] Each operating system 215 to 217 can control the primary operations of its respective logical partition 201 to 203 in the same way as the operating system of a non-partitioned computer. Each logical partition 201 to 203 can execute in a separate memory volume represented by a virtual memory 250 to 252. Furthermore, each logical partition 201 to 203 can statically and / or dynamically allocate a portion of available resources in the system 200. For example, each logical partition 201 to 203 can share one or more of the CPUs 205, 206 as well as a portion of the available memory volume for use in a virtual memory 205 to 252. In this way, a particular CPU 205, 206 can be used by more than one of the logical partitions 201 to 203.

[0035] The hypervisor 146 may include an arbiter routine 251 that controls the allocation of virtual processors 207 to 212 to the CPUs 205, 206 on an allocation list or a ready queue 247. The ready queue 247 includes memory that contains a list of the virtual processors 207 to 212 whose work items are waiting to be allocated to a CPU 205, 206. The Fig. The hypervisor 246 shown in Figure 2 also controls the CPUs 205, 206 and may also control a memory controller 254 and the DIMMs 248, 249. Processor control blocks 249 of the hypervisor 246 include memory containing a list of the virtual processors 207 through 212 waiting to access the CPUs 205, 206.

[0036] Additional resources, such as mass storage, backup storage, user input, network connections, and the like, are typically allocated to one or more logical partitions in a manner well known in the art. Resources may be allocated in different ways, such as bus by bus or resource by resource, with multiple logical partitions sharing resources on the same bus. Some resources may be allocated to multiple logical partitions 201 through 213 simultaneously. Fig. For example, Figure 2 illustrates three logical buses 262, 264, and 266, with a plurality of resources on bus 262, including a direct access storage device (DASD) 268, a tape drive 272, and an optical disk drive 274, associated with a partition.

[0037] The bus 264 may have resources that are individually divided, with a logical partition 202 being assigned, for example, a LAN adapter 276 (Local Area Network), an optical disk drive 278, and a DASD 280, and a logical partition 203 being assigned the LAN adapters 282, 284. The bus 266 may, for example, represent a bus that is specifically assigned to the logical partition 203, so that all resources on the bus 266 (e.g., the DASDs 286, 288) are assigned to one and the same logical partition 203. The Fig. The hardware shown in Figure 2 optionally contains one or more cache memories 265.

[0038] Fig. 3 shows an embodiment of a data processing system for memory compression 300 that includes two processors 302, 312, each with directly attached memories 304, 308, 314, and 318. The processors may be interconnected via a processor bus 305. The system 300 may be configured to utilize a tiered hierarchy of interrupts to manage memory within an environment that includes compressed memory. In particular, the system 300 contains data in a decompressed primary memory 306, 316, 322, which may be mirrored as compressed memory 310, 320. The processors 302, 312 may be provided to the processors 101 to 103 of Fig. 1 and the CPUs 205, 206 of Fig. 2. The memories 304, 308, 314 and 318 may be similar to the memories 117 to 119 of Fig. 1 and DIMMs 248, 249 from Fig. 2 be similar.

[0039] The system 300 also includes a memory controller 303 and buffers 313, 317. The memory controller 303 may be the memory controller 313 of Fig. 1 and the buffers 313, 317 can each be assigned to the buffer 115 of Fig. 1. The hardware of the memory controller 303 of Fig. 3 may include a used sector register (SUR) 330. The used sector register 330 may maintain a running count of the physical memory utilization. The memory controller 303 may further include software-configurable used sector threshold registers (SUTRs) 331 through 334 that function as thresholds. The thresholds of the used sector threshold registers 331 through 334 may be set by an administrator. According to another embodiment, fewer or more used sector threshold registers may be used.

[0040] The used sector threshold registers 331 through 334 can be used to determine when which type of exception is triggered when the thresholds are exceeded. Each used sector threshold register 331 through 334 is software-configurable. For example, a threshold and an interrupt type can be written to each used sector threshold register 331 through 334. If the value of a used sector register exceeds a threshold of a used sector threshold register, the memory controller 303 can throw an exception. For example, the memory controller 303 can throw an exception if the value of the used sector register is less than or equal to a first value of a used sector threshold register and then becomes greater than a first value of the used sector threshold register.

[0041] Likewise, exceeding a second used sector threshold register 331-334 in an opposite direction may trigger an exception associated with a different interrupt. Interrupt types and thresholds may be determined based on the priority of the exception. Each used sector threshold register 331-334 may trigger a different type of exception available in the system 300. For example, software may configure a first used sector threshold register 331 to trigger a regular unit interrupt or maskable interrupt. The used sector threshold register 331 may contain a relatively low threshold. An administrator may configure a second used sector threshold register 332 to trigger a non-maskable interrupt and contain a higher threshold.A third used sector threshold register 333 may trigger a machine check interrupt and be associated with a highest threshold. With increasingly higher thresholds (approaching memory overflow), the priority of the interrupt may increase accordingly. The opposite may be true if the used sector register 330 is decremented, thereby exceeding a used sector threshold register value.

[0042] According to a particular embodiment, a used sector threshold register 331 may be used to trigger the sending of a maskable interrupt to the hypervisor or operating system in response to the available memory exceeding a predetermined threshold. Such a threshold may correspond to a memory capacity at which data can be moved back to physical memory. The thresholds of the used sector threshold registers may be used, in a hierarchical order, to notify the hypervisor or operating system that sufficient memory volume is available. Alternatively, the hypervisor or operating system may query the used sector threshold registers 331 through 334 to estimate the amount of free memory and determine when more data can be moved from disk to physical memory.

[0043] The memory controller 303 may additionally include digital circuitry external to the first processor 302 configured to control a data flow between at least two of the processors 302, 312, the buffers 313, 317, and the memories 304, 308, 314, 318. The buffers 313, 317 may be configured to cooperate with one or more of the processors 302, 312 to temporarily retain data while it is moved between at least two of the processors 302, 312, the buffers 313, 317, and the memories 304, 308, 314, 318. The memory controller 303 may be connected between the first processor 302 and the second memory 308, which includes a first mirrored DIMM memory 310.

[0044] While the used sector threshold register 330 and the used sector threshold registers 331 to 334 of the memory controller 303 may manage the memory for the entire system 300, the embodiment of Fig. 3, that the second processor 312 includes its own used sector threshold register 335 and its own used sector threshold registers 336 to 339 for managing the memory.

[0045] Buffer 313 may be connected between second processor 312 and third memory 314, which includes a second array of DIMM primary memories 316. Third buffer 317 may be connected between second processor 312 and fourth memory 318, which includes the array of mirrored DIMM memories 320 and the third array of DIMM primary memories 322.

[0046] According to the embodiment of Fig. 3, the first mirrored DIMM memory 310 may mirror the second array of DIMM primary memories 316, as indicated by arrow 324. The first mirrored DIMM memory 310 may contain compressed data. For example, the first mirrored DIMM memory 310 may contain a compressed version of the data in the second array of DIMM primary memories 316.

[0047] The array of mirrored DIMMs 320 may mirror the first array of primary DIMMs 306, as indicated by arrow 326. The array of mirrored DIMMs 320 may contain compressed data. For example, the array of mirrored DIMMs 320 may contain a compressed version of the data in the first array of primary DIMMs 306. The compression ratio of the compressed data in the array of mirrored DIMMs 320 compared to the decompressed data in the first array of primary DIMMs 306 may be approximately four to one, as with the first mirrored DIMM 310.

[0048] Arrow 328 indicates that the mirrored DIMM array 320 may mirror the second primary DIMM array 316. For example, one or more of the processors 302, 312 of the memory controller 303 and the buffers 313, 317 may copy and compress data from the second primary DIMM array 316 to be stored in the mirrored DIMM array 320.

[0049] The first processor 302, the second processor 312, the memory controller 303, the buffer 313, and / or the buffer 317 may include compression logic that copies data when it is stored in the first mirrored DIMM memory 310 and the mirrored memory array 320. At least one hypervisor and an operating system, such as the hypervisor 246 and the operating system 215 of Fig. 2, may be configured to control the transition from accessing the second array of DIMM primary memory 316 to accessing the first mirrored DIMM memory 310.

[0050] Fig. 4 shows an embodiment of a method 400 for managing compressed memory using a tiered hierarchy of interrupts that affects the operation of the system based on detected levels of available memory volume. For example, processes may be increasingly affected as memory capacity decreases. Conversely, interrupts may release more and more processes as memory capacity increases. The method 400 may use a machine check interrupt configured to temporarily suspend all threads on all cores of all processors of a computer system. The method 400 may be implemented by any of the systems 100, 200, and 300 of Fig. 1 to 3 are carried out.

[0051] With particular reference to the flowchart, in step 402, a system may perform normal processes for managing memory compression. For example, the system may access and utilize physical memory during normal memory compression operations. The system may determine in step 404 that a value of a used sector register is greater than a threshold of a first used sector threshold register. For example, the memory controller 303 of Fig. 3 that the value of the used sector register 330 is greater than the threshold value of the used sector threshold register 331. According to another embodiment, a hypervisor or an operating system may query the used sector threshold register to estimate the size of the free storage volume.

[0052] Alternatively, if it is determined that the value of a used sector register is greater than the threshold of the first used sector threshold register, a first interrupt may be triggered in step 406. For example, the memory controller 254 may trigger the maskable interrupt 236 of Fig. 2 may be triggered. The maskable interrupt 236 may be sent to the interrupt handler 233 of the hypervisor 246. The interrupt handler 233 may then attempt to respond to the markable interrupt 236 by generating additional memory space.

[0053] The system may determine in step 408 that a value of the used sector register is less than the threshold value of the first used sector threshold register. For example, the memory controller 303 of Fig. 3, detect that the value of the used sector register 330 is less than the threshold value of the used sector threshold register 331. If it is determined that the value of the used sector register is less than the threshold value of the used sector threshold register, memory pages may be moved from disk to physical memory (e.g., dynamic random access memory) in step 410.

[0054] Alternatively, if it is determined that the value of the used sector register is greater than the threshold of the first used sector threshold register, the system may determine in step 412 that the value of the used sector register is greater than the threshold of a second used sector threshold register. For example, the memory controller 303 of Fig. 3 that the value of the used sector register 330 is greater than the threshold value of the used sector threshold register 332.

[0055] If the value of the used sector register is greater than the threshold of the second used sector threshold register, a second interrupt may be triggered in step 414. For example, a non-maskable interrupt 237 may be triggered by the memory control unit 254 of Fig. 2 may be triggered. The non-maskable interrupt 237 may be sent to the interrupt handler 233 of the hypervisor 246. The interrupt handler 233 may attempt to respond to the non-maskable interrupt 237 by generating additional memory space. Conversely, if the used sector register value is less than the threshold of the second used sector threshold register, the system may determine whether a used sector register value is less than the threshold of the first used sector threshold register in step 408.

[0056] In step 416, the system may determine that a value of the used sector register is less than the threshold value of the first used sector threshold register. For example, the memory controller 303 of Fig. 3, detect that the value of the used sector register 330 is less than the threshold value of the used sector threshold register 331. If it is determined that the value of the used sector register is less than the threshold value of the used sector threshold register, memory pages may be moved from disk to physical memory in step 410.

[0057] If, however, it is determined that the value of the used sector register is greater than the threshold of the first used sector threshold register, the system may determine in step 418 that the value of the used sector register is greater than the threshold of a third used sector threshold register. For example, the memory controller 303 of Fig. 3 that the value of the used sector register 330 is greater than the threshold value of the used sector threshold register 333.

[0058] If the value of the used sector register is greater than the threshold of the third used sector threshold register, a machine check interrupt may be triggered in step 420. For example, the machine check interrupt 238 of Fig. 2 may be triggered by the memory control unit 254. The machine check interrupt 238 may be sent to the machine check handler 234 of the hypervisor 246. The machine check handler 234 may attempt to respond to the machine check interrupt 238 by immediately interrupting and transferring all threads to the control of the machine check handler 234. The machine check interrupt 238 may allow the thread processes to resume if a corrective action is successful. That is, the machine check handler 234 may take corrective action and resume execution of the workload if the corrective action is successful.Conversely, if the value of the used sector register is less than the threshold of the third used sector threshold register, the system may determine whether a value of the used sector register is greater than the threshold of the first used sector threshold register in step 418.

[0059] Fig.4 thus shows a flowchart of one embodiment of a method 400 for managing compressed memory using a tiered hierarchy of interrupts that progressively impact system operations based on detected levels of available memory volume. Method 400 may utilize a machine check interrupt configured to temporarily suspend all threads on all cores of all processors of a computer system. Used sector threshold registers may alert a hypervisor or operating system that physical memory is running low while minimizing the performance impact of redundant interrupts.

[0060] Certain embodiments described herein may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment that includes hardware and software elements. According to a particular embodiment, the disclosed methods are implemented by software stored on a processor-readable storage medium and executed by a processor, including, but not limited to, firmware, resident software, microcode, and so on.

[0061] Furthermore, embodiments of the present disclosure, such as the one or more embodiments, may take the form of a computer program product accessible from a computer-usable or computer-readable storage medium providing program code for use by or in connection with a computer or any instruction-executing system. For the purposes of this description, a computer-usable or computer-readable storage medium may be any device that can materially embody a computer program and contain, store, transmit, distribute, or transport the program for use by or in connection with the instruction-executing system, apparatus, or device.

[0062] According to various embodiments, the medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system (or device or unit) or distribution medium. Examples of a computer-readable storage medium include, but are not limited to, semiconductor memory, magnetic tape, a removable computer diskette, random access memory (RAM), read-only memory (ROM), a rigid magnetic disk, and an optical disk. More recent examples of optical disks include, but are not limited to, compact disc read-only memory (CD-ROM), compact disc read / write (CD-R / W), and digital multi-purpose disc (DVD).

[0063] A data processing system capable of storing and / or executing program code may include at least one processor connected directly or indirectly to storage elements via a system bus. The storage elements may include local memory used during the actual execution of the program code, mass storage, and cache memory used to temporarily store at least a portion of the program code to reduce the number of accesses to code in mass storage during execution.

[0064] Input / output or I / O devices (including, but not limited to, keyboards, monitors, pointing devices, etc.) may be connected to the data processing system directly or indirectly through intermediate I / O control devices. Network adapters may also be connected to the data processing system to enable the data processing system to connect to other data processing systems or external printers or storage devices through intermediate private or public networks. Modems, cable modems, and Ethernet cards are just a few of the types of network adapters currently available.

[0065] The above description of the disclosed embodiments is provided to enable one skilled in the art to make or use the disclosed embodiments. Many modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be applied to other embodiments without departing from the scope of the disclosure. For example, some of the embodiments described above may involve hardware interrupts, while other embodiments of an interrupt may involve software instructions such as "if, then" or "conditional jump" based on the amount of available physical memory. Such conditional software interrupts may function similarly to a hardware interrupt in that the execution of the current process may be interrupted and the execution of code to handle the memory may begin.A hardware interrupt may occur asynchronously with code execution and at any point in the code, while in one execution mode of the program, the available memory may need to be checked separately using software code instructions. Thus, the present disclosure is not intended to be limited to the embodiments shown herein, but should be interpreted as broadly as possible within its scope according to the principles and features defined by the following claims.

Claims

[1] A method for managing memory accessed by a first process executed by a processor, wherein a count value indicates a current utilization of the physical capacity of the memory, the method comprising: - triggering a first interrupt in response to the count value exceeding a first threshold, the first interrupt being a maskable interrupt receivable by an interrupt handler which, as a result, attempts to create available physical memory; - triggering a second interrupt in response to the count value exceeding a second threshold that is greater than the first threshold, the second interrupt being a non-maskable interrupt guaranteed to be received by the interrupt handler, which consequently attempts to create available physical memory; and - triggering a third interrupt in response to the count value exceeding a third threshold that is greater than the second threshold, the third interrupt being a machine check interrupt that interrupts all activity on the processor and that is received by a machine check handler that consequently attempts to create available physical memory. [2] The method of claim 1, further comprising interrupting a plurality of processes executing on a plurality of processors in response to triggering the third interrupt. [3] The method of claim 2, further comprising automatically resuming the plurality of processes executing on the plurality of processors. [4] The method of claim 1, further comprising configuring the first and second interrupts such that the second interrupt impacts the first process more than the first interrupt. [5] The method of claim 1, further comprising configuring the first and second interrupts such that the second interrupt is more likely to affect the first process than the first interrupt. [6] The method of claim 1, further comprising configuring the first and second interrupts such that the second interrupt affects the first process less than the first interrupt. [7] The method of claim 1, further comprising detecting at least one of the first, second, and third interrupts. [8] The method of claim 1, further comprising storing overflow data in a flash memory device to create free memory space. [9] The method of claim 1, wherein the count value is determined by accessing a used sector register. [10] Device comprising: - a memory; and - a processor configured to execute a first process that accesses the memory; - where a count value indicates a current utilization of the physical capacity of the memory and the processor is further configured to: - triggering a first interrupt in response to the count value exceeding a first threshold, the first interrupt being a maskable interrupt receivable by an interrupt handler which, as a result, attempts to create available physical memory; - triggering a second interrupt in response to the count value exceeding a second threshold that is greater than the first threshold, the second interrupt being a non-maskable interrupt guaranteed to be received by the interrupt handler, which consequently attempts to create available physical memory; and - triggering a third interrupt in response to the count value exceeding a third threshold that is greater than the second threshold, the third interrupt being a machine check interrupt that interrupts all activity on the processor and that is received by a machine check handler that consequently attempts to create available physical memory. [11] The apparatus of claim 10, further comprising a plurality of processors executing a plurality of processes interrupted by the machine check interrupt. [12] The apparatus of claim 10, further comprising program code executable by the processor and generating the first interrupt, the program code being stored in a separate memory. [13] The apparatus of claim 10, wherein the first and second interrupts are configured such that the second interrupt affects the first process more than the first interrupt. [14] A program product comprising program code for managing memory according to a method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Compression store free-space management

    US7024512B1