Persistent memory device and operating system thereof
By designing a persistent memory device operating system, the management limitations of existing technologies when dealing with persistent memory are solved, and efficient memory resource management and performance improvement are achieved, especially in multi-processor systems, providing faster data Processing speed and higher resource utilization.
Patent Information
- Application Number
- CN202410744100.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-11
- Publication Date
- 2024-09-24
AI Technical Summary
Existing memory management technology has limitations when dealing with persistent memory and cannot fully realize its potential. Especially under the non-uniform memory access architecture in multi-processor systems, it is difficult to effectively manage and optimize memory resources.
A persistent memory device operating system is designed, including the persistent memory management subsystem, CPU subsystem, storage subsystem and network subsystem, through the confidentiality/integrity/availability guarantee method function verification subsystem and memory access mode security subsystem. , Based on the persistent memory tail delay optimization subsystem, persistent memory pool management subsystem and software and hardware collaborative persistent memory availability subsystem, it provides efficient memory allocation and management strategies, and supports CXL+PMEM management and heterogeneous memory management.
Significantly improves the performance of the persistent memory prototype, especially when processing large-scale data sets and performing high-performance computing tasks, providing faster data processing speeds and higher resource utilization, and enhancing the security of persistent memory and reliability.
Smart Images

Figure CN118689643A
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of computer systems, and in particular relates to a persistent memory device and an operating system thereof. Background Art
[0002] With the growing demand for computing, especially in the fields of big data processing, high-performance computing (HPC) and artificial intelligence (AI), the performance requirements for computer systems are also increasing. In these high-performance applications, the performance of the memory system has become a key factor restricting the overall system efficiency. Traditional memory systems usually rely on dynamic random access memory (DRAM) as the main memory, however, the volatility and limited storage capacity of DRAM become a bottleneck when processing large amounts of data.
[0003] To overcome these limitations, persistent memory (PM) technology has emerged. Persistent memory provides non-volatile storage that can retain data after power failure, while providing access speeds close to DRAM. However, integrating persistent memory with existing memory management systems faces the challenge of how to effectively manage and optimize memory resources. In particular, in multi-processor systems, the introduction of non-uniform memory access (NUMA) architecture increases the complexity of memory management.
[0004] Existing memory management technologies, although relatively mature in managing DRAM, are insufficient when dealing with persistent memory. Existing memory management interfaces and tools also have limitations when dealing with persistent memory. They often lack a deep understanding and optimization of persistent memory characteristics and cannot fully tap the potential of persistent memory. Therefore, a new memory management system is needed that can fully exploit the advantages of persistent memory while providing efficient memory allocation and management strategies to meet modern computing needs.
[0005] The present disclosure relates to the following terminology.
[0006] CXL: The full name is Compute Express Link, which is a high-performance, open-standard, high-speed interconnection protocol proposed by Intel in 2019. It aims to provide a general-purpose, high-bandwidth, low-latency interconnection solution for connecting processors, accelerators, storage, and other devices. The goal of CXL is to support high-performance computing and storage applications in data centers, as well as workloads that require large-scale parallel processing. The development of CXL has gone through multiple versions of iterations. With the update of the version, CXL continues to introduce new features to adapt to the changing technology trends and market needs. The present invention is based on versions 2.0 and 3.0.
[0007] NUMA: Non-Uniform Memory Access, is a computer memory design used in multi-processor systems, where each processor has its own local memory. In the NUMA architecture, the processor can access local memory as well as remotely access the memory of other processors. This design aims to improve the performance of multi-processor systems by reducing memory access latency between processors, thereby improving the overall computing efficiency of the system.
[0008] DRAM: The full name is Dynamic Random Access Memory. It is a type of random access memory used to store data and code in computers or other devices. It is known for its relatively low cost, high speed and large capacity. DRAM maintains information by constantly refreshing the charge in the storage cell.
[0009] BUDDY: Buddy system is a memory allocation and management technology. In the operating system, it is used to efficiently allocate and recycle memory blocks while reducing memory fragmentation.
[0010] SLAB: The full name is SLAB Allocator, a memory allocation mechanism designed to solve the performance problems caused by frequent allocation and release of small blocks of memory in the kernel. It is suitable for processing objects of similar size and frequently used, such as file descriptors, process control blocks and other kernel data structures. CPU: Central Processing Unit, one of the main hardware of the computer, is responsible for interpreting the instructions of the computer program and processing the data in the program. Almost all computing and data processing tasks are completed by it.
[0011] TCM: The full name is Trusted Computing Module. A trusted computing module is a hardware device designed to provide a secure computing environment and ensure the integrity and confidentiality of data. These modules usually include security features such as encryption and decryption functions, secure boot, authentication, and session key management. Summary of the invention
[0012] The present disclosure provides an operating system for a persistent memory device. The operating system includes:
[0013] Persistent memory management subsystem, CPU subsystem, storage subsystem and network subsystem,
[0014] The persistent memory management subsystem includes a confidentiality / integrity / availability assurance method functional verification subsystem, a memory access mode security subsystem, a persistent memory tail latency optimization subsystem, a persistent memory pooling management subsystem, a software-hardware collaborative persistent memory availability subsystem, and a persistent memory platform demonstration subsystem.
[0015] The confidentiality / integrity / availability assurance method functional verification subsystem has integrity assurance and optimization methods, data encryption and optimization methods, and persistent memory security metadata management.
[0016] The memory access mode security subsystem has side channel attacks and defenses with persistent memory characteristics, as well as a wear leveling strategy.
[0017] The persistent memory-based tail delay optimization subsystem has a tail delay optimization mechanism, a balanced index tree, and a data pre-reading mechanism.
[0018] The persistent memory pooling management subsystem has a data crash consistency guarantee mechanism, a data reliability mechanism, a load balancing and life delay mechanism.
[0019] The software and hardware collaborative persistent memory availability subsystem has lightweight and efficient memory pooling management, dynamic secure memory allocation and scheduling, multi-level security protection, and a secure memory fault prediction mechanism.
[0020] The persistent memory platform demonstration subsystem has CXL+PMEM management, heterogeneous memory management, and application support tools.
[0021] The disclosed embodiments implement software for supporting persistent memory device operating systems to support developers and system administrators to use and manage memory resources more efficiently. Through the disclosed embodiments, the performance of persistent memory prototypes can be significantly improved, especially when processing large-scale data sets and performing high-performance computing tasks, providing faster data processing speeds and higher resource utilization. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood by reading the following detailed description with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, in which:
[0023] Figure 1 A schematic diagram of a confidentiality / integrity / availability assurance method and a functional verification subsystem according to one embodiment of the present invention.
[0024] Figure 2 A schematic diagram of a subsystem for ensuring memory access mode security according to one embodiment of the present invention.
[0025] Figure 3 Schematic diagram of a persistent memory-based tail latency optimization subsystem according to one embodiment of the present invention.
[0026] Figure 4 A diagram of a persistent memory pooling management system according to one embodiment of the present invention.
[0027] Figure 5 A schematic diagram of a persistent memory availability subsystem according to one embodiment of the present invention.
[0028] Figure 6 A schematic diagram of a persistent memory platform demonstration subsystem according to one embodiment of the present invention.
[0029] Figure 7 A schematic diagram of a persistent memory device system software architecture according to one embodiment of the present invention. DETAILED DESCRIPTION
[0030] This disclosure proposes a set of supporting system software for persistent memory devices, which is optimized for a hybrid memory architecture of persistent memory supporting the CXL protocol and ordinary DRAM. The system adopts the NUMA architecture and realizes refined management of memory resources through precise memory mapping and efficient memory allocation algorithms. In addition, the system also provides a complete set of application layer interfaces, including memory allocator APIs, persistent memory management tools, and system file system APIs, to support developers and system administrators to use and manage memory resources more efficiently.
[0031] The disclosed system software takes persistent memory management as the core, utilizes the existing operating system's abstraction of memory, and sets management methods such as NUMA-based EXPMEM to ensure good ecological compatibility.
[0032] The system software disclosed in the present invention mainly includes two parts: memory management module and other modules. Other modules include CPU subsystem, storage subsystem and network subsystem. The functions included in the CPU subsystem include CXL protocol support, PCIE affinity management, process management, and the function package implemented by the storage subsystem includes SSD driver, HDD driver, file system and application interface. The functions included in the network subsystem include OCP3.0 support, PCIE*16 support and driver adaptation. The above-mentioned other modules will be transplanted and adapted, which do not belong to the main invention content of this patent. They are only a supplementary part of the system software memory management module. The invention of this patent will focus on the research and development of the memory management module.
[0033] The memory management module will be divided into six subsystems for persistent memory management. The six subsystems are the confidentiality / integrity / availability assurance method functional verification subsystem, the memory access mode security subsystem that can effectively ensure the security of the memory, the tail latency optimization subsystem based on persistent memory, the efficient and secure persistent memory pooling management system, the software and hardware collaborative persistent memory availability subsystem, and the efficient and secure persistent memory platform demonstration subsystem.
[0034] The confidentiality / integrity / availability assurance method functional verification subsystem mainly implements functions including integrity assurance and optimization methods, data encryption and optimization methods, persistent memory security metadata management, and basic framework such as Figure 1 shown.
[0035] The subsystem can effectively protect the memory access mode security, and its main functions include side channel attacks and defenses with persistent memory characteristics, wear leveling strategies, and basic frameworks such as Figure 2 shown.
[0036] The tail delay optimization subsystem based on persistent memory mainly implements the following functions: tail delay optimization mechanism, balanced index tree, data pre-reading mechanism, and basic framework. Figure 3 shown.
[0037] The efficient and secure persistent memory pool management system mainly implements the following functions: data crash consistency guarantee mechanism, data reliability mechanism, load balancing and life delay mechanism. The basic framework is as follows: Figure 4 shown.
[0038] The hardware-software collaborative persistent memory availability subsystem mainly implements functions including lightweight and efficient memory pool management, dynamic secure memory allocation and scheduling, multi-level security technology, secure memory fault prediction mechanism, and basic framework such as Figure 5 shown.
[0039] The high-efficiency and secure persistent memory platform demonstration subsystem mainly implements functions including CXL+PMEM management, heterogeneous memory management, application support tools, and basic framework such as Figure 6 shown.
[0040] The confidentiality / integrity / availability assurance method functional verification subsystem includes a data integrity assurance method based on the domestic trusted module TCM, which ensures the integrity of persistent memory data based on the uniqueness of hash value mapping, and uses the memory data integrity assurance method of Bonsai Merkle Tree to build a tree-structured message authentication code on top of the persistent memory. The tree root is stored on the trusted root TCB of TCM to ensure its isolation. A built-in integrity attack model adapted to the characteristics of persistent memory is used to distinguish between data deception attacks, data splicing attacks, and data replay attacks, while reducing the overhead of integrity verification.
[0041] The subsystem that can effectively ensure the security of memory access mode includes mechanisms for traditional side channel attacks and unique attacks on persistent memory-specific side channels. On processors based on the CXL2.0 / 3.0 protocol, monitoring of traditional side channels, including information leakage and defense mechanisms for Cache and TLB, is established; on persistent memory devices based on the CXL2.0 / 3.0 protocol, detection of persistent memory-specific side channels, including information leakage and defense mechanisms for read-write cache and indirect remapping tables for wear leveling, is established; a wear leveling strategy for persistent memory is constructed, DRAM absorption and merging is used for high-frequency update loads, and a recalculation mechanism is used for high-frequency query loads to reduce write operations, a garbage collection mechanism based on the CXL+persistent memory file system is established, and hot and cold data are exchanged in combination with the garbage collection mechanism when mixed read-write loads are in place to improve efficiency; a page cache based on aggregated multiple writes in the CXL+persistent memory file system is constructed, swap requests are triggered for cold data, and write operations are guided to be imported into storage.
[0042] The tail delay optimization subsystem based on persistent memory builds a tail delay management structure and algorithm based on persistent memory, optimizes query functions, uses priority queues to manage memory access requests, and dynamically adjusts the selected algorithms and data structures based on the request cost as an indicator. Improve query efficiency by building a balanced index tree based on hash indexes. Establish a data pre-reading mechanism for persistent memory, establish an RCU mechanism, reduce page fault interrupts by reducing read-write conflicts and pre-reading pages that may be used; optimize the pre-read hit rate, optimize the long-tail access ratio by dynamically adjusting the page size, or analyzing historical information; build a cache mechanism for memory access read sequences to reduce context overhead.
[0043] The efficient and secure persistent memory pool management subsystem establishes a lightweight, efficient and secure memory management mechanism and a vulnerability recovery mechanism to reduce the threat of bus monitoring and memory scanning attacks to sensitive data in persistent memory; the recovery tree is rebuilt in the SGX area for memory crash recovery and secure persistence; a multi-granularity management mechanism for persistent memory is established, including the operating system software construction mechanism for management granularities such as Node, Buddy, Zone, and Page in the CXL+PMEM scenario, as well as a page cache mechanism and a swap mechanism; a CXL-based SLD persistent memory pool is constructed to realize the dynamic allocation and scheduling of different persistent memory bars by different processors. A persistent memory bar is a physically pluggable persistent memory device; an MLD persistent memory pool is constructed to realize the dynamic allocation and scheduling of multiple logical partitions of different memory bars by different processors. A persistent memory-level security guarantee is established, including CPU caches at all levels in the north, home agents that support CXL, and high-performance SSDs and various disk arrays in the south; a lock protection mechanism and an independent encryption mechanism are constructed for each subsystem in the persistent memory prototype to indirectly improve the security of the persistent memory itself. Utilizing the application characteristics of persistent memory, test its timing diagram when accessing memory, summarize the process status, cache status, and TLB status when the failure occurs, build a prediction mechanism for memory failure, establish an EDAC framework that adapts to memory characteristics, and collect error information from the memory controller, CPU cache controller, and CXL controller.
[0044] The hardware-software collaborative persistent memory availability subsystem establishes a data crash consistency guarantee mechanism for the persistent memory system, creates and rebuilds data in situ at the checkpoint, and reduces data migration during the checkpoint establishment and recovery process; establishes a persistent memory reconstruction mechanism to achieve fast verification and orderly reconstruction based on urgency to ensure rapid recovery of system functions; establishes a data mapping mechanism based on data features to achieve dynamic scheduling of data across media; establishes a dynamic allocation and release mechanism for persistent memory based on CXL devices to achieve load balancing of the persistent memory system, and implements DRAM write operations for hot data based on the distribution characteristics of cold and hot data; designs a dynamic method for fusing and splitting persistent memory blocks based on the memory access frequency of persistent applications to achieve multi-granularity load balancing.
[0045] The efficient and secure persistent memory platform demonstration subsystem is mainly used to build a tool chain for persistent memory systems, so that users can quickly use the system. It mainly includes two parts, persistent memory command line management tool and software-defined hierarchical memory management. The management tool builds BIOS layer command line management and configuration for bandwidth and latency testing functions, builds operating system command line capacity configuration for persistent memory health management interface, and builds BIOS layer persistent memory training management interface for persistent memory access mode management. The hierarchical memory management builds a DIMM-based DDR memory management mechanism for the management of kernel layer hybrid memory, builds PCIE+CXL-based DDR memory management for the hybrid memory management of the application layer, and builds PCIE+CXL-based persistent memory management for pooling management based on SLD and MLD.
[0046] According to one or more embodiments, the memory management module, the design of the entire module will be divided into three layers, including hardware layer, kernel layer, and application layer. The overall design architecture is as follows Figure 7 As shown, it is assumed that the two processors in the persistent memory device are CPU1 and CPU2.
[0047] At the hardware layer, for each CPU, the memory adopts a hybrid storage mode of DRAM and PMEM. Each CPU node is equipped with two types of memory devices. The first type is DRAM of a certain capacity. The sample is assumed to be a group, totaling 64G, which is used for fast data access and caching; the second type is composed of persistent memory devices that support the CXL protocol. It is assumed that each CPU is connected to 3 devices in total, and the capacity of each device is 128G, providing persistent storage.
[0048] In the kernel layer, the NUMA (non-uniform memory access) structure is adopted. The memory in the system is divided into multiple nodes. Each node is related to a CPU. The NUMA architecture has the following characteristics: the processors on different nodes access the local memory node at different speeds, and each node has its own specific latency and bandwidth.
[0049] Assume that for CPU1, it corresponds to node1. In node1, for a set of 64G DRAM and 2 PMEM devices, the same structure is used, and the remaining PMEM device is used for data exchange of the CXL protocol. In DRAM, the Normal Zone is the main area, designed in the middle area of the physical memory, between DMA and High MEM. The memory in this area maps the physical memory in DRAM to virtual memory, and the virtual memory is divided into Pages. At the same time, the physical memory will also be organized in pages of the same size. The CPU can directly access these Pages through virtual addresses without additional address conversion or special processing. The Normal Zone has NUMA awareness. The operating system can try to direct memory allocation requests to the Zone where the request is initiated to reduce the memory access latency across NUMA nodes. Among PMEM devices, the EXPMEM Zone can be used by the CPU to specifically manage the memory on the EXPMEM device, thereby improving performance. The Zone contains a certain number of Pages, which store data exchanged with the CPU.
[0050] At the same time, two memory allocation algorithm systems will be configured in node1, the Buddy system and the Slab allocator.
[0051] The Buddy system is used to manage the kernel memory of the operating system. In the buddy system, the memory is divided into blocks of power-of-2 size, and blocks with adjacent addresses are organized into buddy pairs. Memory blocks of each level always appear in pairs. When a memory block is allocated, the system will automatically find a buddy block of the right size, split it into two smaller blocks, and then assign one of them to the requested task. Assume that the current state of the buddy memory in node1 is 1024KB in total, consisting of five sizes of 32KB, 64KB, 128KB, 256KB, and 512KB, and each size maintains a free available table. And, further comprising the following steps:
[0052] Step 1: CPU1 requests node1 to allocate a 128KB memory block and checks whether the 128KB buddy is available. If the 128KB buddy is not available, it must check upwards.
[0053] Step 2: When the size of 512KB is detected, there is a free block A marked as free and available. Then the free block A will be divided into two 256KB buddy pairs B and C. Since 128KB<256KB / 2, B will be divided into two 128KB buddy pairs D and E.
[0054] Step 3: Allocate D to the requesting process, mark C and E as free and available, and make block A non-free and available.
[0055] Step 4: The process releases a 128KB memory block F. At this time, the buddy pair of F is checked. There is no free block and the merge cannot be performed. At this time, the memory block F is also added to the 128KB free available table.
[0056] Step 5. The process releases a 64KB memory block G and checks the Buddy pair of G. If it is a free available block, then G is merged with its Buddy pair to form a 128KB memory block K. Next, continue checking. K is adjacent to the E memory block mentioned above, so it can be regarded as a Buddy pair. They are merged to form a new 256KB J. Continue checking until they cannot be merged, and then add it to the free available table of the corresponding level.
[0057] The Slab allocation can be used to effectively manage small memory blocks of objects, which is very suitable for objects that are frequently allocated and destroyed. In Slab, memory is allocated as slab blocks of fixed size. Each slab can accommodate a certain number of objects. When memory allocation is required, the system will allocate an object from a slab of the corresponding size. The Slab allocator is built on the buddy system, further refining the granularity of the buddy system and dividing the pages provided by the buddy system into smaller storage units for allocation and recycling.
[0058] In the kernel layer, compatible / optimization system calls and file system support are designed to provide a user interface to the application layer.
[0059] The kernel layer uses the E820 standard to describe the layout of physical memory.
[0060] In the application layer, three types of interfaces are provided: compatible / optimization API, CXL PMEMManagement Tool, and System Filesystem API.
[0061] The compatible / optimization API is a programming interface for handling memory allocation, release, and memory operation optimization. It includes memory-related data structures, algorithms, and tools to improve program performance and resource utilization. This type of interface includes the Allocator API, which allows developers to choose different allocation strategies, such as stacks and pooling, to meet the specific needs of the program; the Memory Pool API, which is used to reduce memory fragmentation and increase the speed of allocation; Smart Pointers, which encapsulate pointers and provide automatic memory management, help prevent memory leaks, and improve the security of the user's code.
[0062] The CXL PMEM Management Tool, such an interface, provides a persistent memory management tool to the application layer.
[0063] The System Filesystem API builds a filesystem virtual file system and provides a communication interface between the kernel layer and the device. This type of API allows users and user space applications to access kernel information and configuration parameters through files and directories. This includes information about system components such as devices, drivers, and buses.
[0064] It should be understood that in the embodiments of the present invention, the term "and / or" is only a description of the association relationship of the associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0065] It is worth noting that, although the foregoing content has described the spirit and principle of the invention with reference to several specific embodiments, it should be understood that the invention is not limited to the disclosed specific embodiments, and the division of various aspects does not mean that the features in these aspects cannot be combined, and such division is only for the convenience of expression. The invention is intended to cover various modifications and equivalent arrangements included in the spirit and scope of the appended claims.
Claims
1. A persistent memory device operating system, It is characterized in that The operating system includes: Persistent memory management subsystem, CPU subsystem, storage subsystem and network subsystem, The persistent memory management subsystem includes a confidentiality / integrity / availability assurance method functional verification subsystem, a memory access mode security subsystem, a persistent memory tail latency optimization subsystem, a persistent memory pooling management subsystem, a software-hardware collaborative persistent memory availability subsystem, and a persistent memory platform demonstration subsystem.
2. The persistent memory device operating system according to claim 1, It is characterized in that The confidentiality / integrity / availability assurance method functional verification subsystem has integrity assurance and optimization methods, data encryption and optimization methods, and persistent memory security metadata management.
3. The persistent memory device operating system according to claim 1, It is characterized in that The memory access mode security subsystem has side channel attacks and defenses with persistent memory characteristics, as well as a wear leveling strategy.
4. The persistent memory device operating system according to claim 1, It is characterized in that The persistent memory-based tail delay optimization subsystem has a tail delay optimization mechanism, a balanced index tree, and a data pre-reading mechanism.
5. The persistent memory device operating system according to claim 1, It is characterized in that The persistent memory pooling management subsystem has a data crash consistency guarantee mechanism, a data reliability mechanism, a load balancing and life delay mechanism.
6. The persistent memory device operating system according to claim 1, It is characterized in that The software and hardware collaborative persistent memory availability subsystem has lightweight and efficient memory pooling management, dynamic secure memory allocation and scheduling, multi-level security protection, and a secure memory fault prediction mechanism.
7. The persistent memory device operating system according to claim 1, It is characterized in that The persistent memory platform demonstration subsystem has CXL+PMEM management, heterogeneous memory management, and application support tools.
8. The persistent memory device operating system according to claim 1, It is characterized in that The persistent memory management subsystem includes a hardware layer, a kernel layer, and an application layer, and the hardware layer includes at least two CPUs.
9. The persistent memory device operating system according to claim 8, It is characterized in that The CPU is equipped with two types of memory, The first type is DRAM, which is used for fast data access and caching; The second category is persistent memory that supports the CXL protocol.
10. A persistent memory device, It is characterized in that The memory device is configured as a persistent memory device operating system as described in claim 1.
Citation Information
Cited By
Memory training method and device, electronic equipment and storage medium
CN119248358A
