Tail delay optimization system, method and equipment based on persistent memory

By adopting a tail delay optimization subsystem based on persistent memory in the distributed system, using hash index, RCU mechanism and read-ahead technology, the tail delay problem is solved, system performance and efficiency are improved, and a more efficient service experience is provided. .

CN118689642APending Publication Date: 2024-09-24SHANGHAI JIAOTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410744087.7
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

Technical Problem

In a distributed computing environment, tail latency occurs frequently, leading to a reduction in overall system efficiency. Existing mitigation strategies may lead to a decrease in system throughput or an increase in bandwidth burden.

Method used

Adopt a tail delay optimization subsystem based on persistent memory, including tail delay management structure and algorithm, persistent memory data pre-reading mechanism and memory access request management module, through hash index, RCU mechanism, read-ahead hit rate optimization, concurrent memory access request Respond and apply memory access feature learning and other technologies to optimize tail latency.

Benefits of technology

It significantly improves the performance and efficiency of distributed systems, provides users with a smoother and more efficient service experience, reduces the impact of tail delays, and improves the overall system throughput.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118689642A
    Figure CN118689642A
Patent Text Reader

Abstract

The invention discloses a tail delay optimization system based on a persistent memory. The system comprises a tail delay management module, a persistent memory data pre-reading module and a memory access request management module. The tail delay management module is used for improving a memory management structure so as to reduce tail delay; the persistent memory data pre-reading module is used for pre-reading the persistent memory; and the memory access request management module is used for memory access request management. And the tail delay management module is used for comparing a plurality of management structures and algorithms, constructing a hash index, operating an interface and realizing the functions of addition, deletion, modification and checking. And the persistent memory data pre-reading module realizes functions of an RCU (Remote Control Unit) mechanism based on a persistent memory, a pre-reading hit rate optimization mechanism and a cache mechanism of a memory access read sequence.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of computer systems, and in particular, relates to a tail delay optimization system, method and device based on persistent memory. Background Art

[0002] In the field of storage technology, persistent memory (PMEM) has become a revolutionary technology. It not only inherits the fast read and write performance of traditional random access memory (RAM), but also absorbs the data persistence advantages of solid-state storage devices (such as solid-state drives, SSDs). Therefore, persistent memory combines the speed of RAM and the durability of solid-state storage. After a power outage, its data can still be retained, providing the system with persistent data storage guarantees. In addition, the introduction of persistent memory effectively makes up for the performance, capacity and latency shortcomings between memory (DRAM) and solid-state drives (SSDs) in the hierarchical storage architecture, providing a more comprehensive storage solution for modern computing systems.

[0003] The following terms are referred to in this disclosure.

[0004] MMU: The memory management unit is responsible for handling the mapping between virtual memory and physical memory and related memory access control. MMU plays a key role in modern computing systems, allowing the operating system to manage memory more efficiently and securely.

[0005] RAM: RAM (Random Access Memory) is a form of data storage in a computer system that allows data to be read and written. Unlike long-term storage devices such as hard drives or SSDs (Solid State Drives), RAM does not retain data when the power is turned off. Therefore, it is often used to store information that is being processed by the CPU (Central Processing Unit) for quick access.

[0006] RCU mechanism: RCU (Read-Copy-Update) is a synchronization mechanism, mainly used in scenarios with more reads than writes. The basic idea of ​​RCU is to use version control and delayed recycling to ensure the consistency and security of concurrent access.

[0007] SSD: SSD (Solid State Drive) is a data storage device used to permanently save and access data. It uses solid-state storage technology, which provides faster data access speed and higher reliability compared to traditional mechanical hard disks (HDDs).

[0008] DRAM: DRAM (Dynamic Random Access Memory) is a type of RAM. It is a common type of computer memory used to store data and program code for use by the central processing unit (CPU). It is one of the main forms of memory in computers and other electronic devices.

[0009] AVL tree: A self-balancing binary search tree. In an AVL tree, the height difference between the two subtrees of any node does not exceed one. If at any time their heights differ by more than one, a rebalance is performed to restore this property. This structure allows the AVL tree to maintain a low depth during insertion and deletion operations, thereby providing high efficiency in search operations.

[0010] CPU: Central Processing Unit, which is responsible for interpreting and executing most computer instructions, including running the operating system, applications, and processing user input. It determines the efficiency and speed at which the computer processes tasks.

[0011] L1, L2 cache: L1 and L2 cache are cache levels used to store data and instructions in computer processors. These caches are designed to reduce the number of times the processor accesses main memory (RAM) because accessing data from cache is much faster than accessing from main memory.

[0012] preftchBlockCount: The number of data blocks read each time during data pre-reading. This value is dynamically adjusted through machine learning.

[0013] t_interval: The time interval for calculating the memory hit rate each time.

[0014] change_limit: The maximum change allowed by the prefetchBlockCount value set to prevent the prefetched data blocks from fluctuating too much. Summary of the invention

[0015] One of the embodiments of the present disclosure is a tail delay optimization subsystem based on persistent memory, which includes a tail delay management structure and algorithm module, a persistent memory data pre-reading mechanism module, and a memory access request module.

[0016] The tail delay management structure module includes multiple management structures and algorithm comparison units, hash index construction and operation interface, and add, delete, modify and query function implementation unit; the persistent memory data pre-reading mechanism includes an RCU mechanism based on persistent memory, a pre-reading hit rate optimization mechanism, and a cache mechanism for memory access read sequences; the memory access request management module includes a concurrent memory access request response mechanism, an application memory access feature learning and classification mechanism, and a memory access request persistence and consistency optimization mechanism.

[0017] The beneficial effect of the embodiments of the present disclosure is that the present disclosure optimizes the tail delay of the parallel system based on PMEM and has a wide range of long-term application value. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] 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:

[0019] Figure 1 An overall architecture diagram of a persistent memory-based tail latency optimization subsystem according to one embodiment of the present invention.

[0020] Figure 2 A diagram of a tail delay management structure and algorithm framework according to one embodiment of the present invention.

[0021] Figure 3 One of the embodiments according to the present invention is a diagram of an example hash page table.

[0022] Figure 4 A framework diagram of a persistent memory data pre-reading mechanism according to one embodiment of the present invention.

[0023] Figure 5 One of the embodiments of the present invention is a memory access request management framework diagram. DETAILED DESCRIPTION

[0024] In actual distributed computing environments, tail latency has become a problem that needs to be solved urgently. Tail latency refers to extremely high latency that occurs in a small number of systems. For large-scale distributed systems, this tail latency effect is particularly significant. For example, when processing large-scale search engine requests, although most requests can be processed quickly, a small number of requests still encounter extreme latency, causing the entire system to have to wait for these tail latency responses before providing services to users.

[0025] At present, the industry has proposed some tail delay mitigation strategies, such as overload protection and traffic shaping. Although these methods can smooth the load to a certain extent and reduce the impact of tail delay, they may also cause the overall throughput of the system to decrease. Another strategy is to send redundant requests to prevent the delayed arrival of individual requests, but this method undoubtedly increases the bandwidth burden.

[0026] To address this problem, the present disclosure proposes a tail latency optimization subsystem based on persistent memory. Here, the so-called subsystem is relative to the persistent memory device system. The subsystem mainly optimizes the tail latency based on mechanisms such as pre-reading. Since tail latency frequently occurs in distributed computing environments and has a serious impact on overall efficiency, the device and method provided by the present disclosure have extremely high practical application value. Through this innovative solution disclosed in the present disclosure, the performance and efficiency of distributed systems can be significantly improved, providing users with a smoother and more efficient service experience.

[0027] According to one or more embodiments, the present disclosure proposes a tail latency optimization subsystem based on persistent memory to solve the problem that tail latency in large-scale systems affects overall performance. Figure 1 The following is a framework diagram of a tail latency optimization subsystem based on persistent memory. The system includes a tail latency management structure and algorithm, a persistent memory data pre-reading mechanism, and a memory access request management.

[0028] The tail delay management structure and algorithm include three parts: comparison of multiple management structures and algorithms, construction and operation interface of hash index, and implementation of add, delete, modify and query functions. Figure 2 As shown, the tail delay management structure and algorithm also include optimization of query performance, construction and operation interface of a balanced index tree, deletion performance optimization, etc.

[0029] The data pre-reading mechanism of the persistent memory includes an RCU mechanism based on the persistent memory, a pre-reading hit rate optimization mechanism and a cache mechanism for access read sequences. The framework diagram is shown in FIG. Figure 3 The data pre-reading mechanism of the persistent memory also includes page fault interrupt optimization, long tail access ratio optimization, and reduction of context switching overhead.

[0030] The memory access request management includes concurrent memory access request response mechanism, application memory access feature learning and classification, and optimization of persistence and consistency requirements of memory access requests. The framework diagram is as follows: Figure 4 The memory access request management also includes data read and write type, memory access medium type, and migration path.

[0031] In the tail delay management structure and algorithm:

[0032] The main purpose of comparing various management structures and algorithms is to optimize query performance, by selecting and using better algorithms and data structures to reduce the number of tail delay responses from the source. Use priority queues to manage memory access requests, and use the cost of the request and the waiting time of the request as indicators to determine the priority of the request and adjust it dynamically. In addition, a backup request algorithm is used, that is, when the original request is not completed within the expected time, one or more backup requests are started to reduce the long delay caused by incidental events;

[0033] The hash index construction and operation interface builds a balanced index tree based on the hash index. Compared with the linear hash list, it has better time efficiency when searching in the event of hash conflicts.

[0034] The tail delay management structure and algorithm achieve the effect of optimizing tail delay by implementing and utilizing the memory hash page table to improve the functions of adding, deleting, modifying and checking. Figure 5 shown.

[0035] In the data pre-reading mechanism of the persistent memory:

[0036] The RCU mechanism reduces page faults by reducing read-write conflicts and pre-reading pages that may be used into memory;

[0037] The purpose of pre-read command rate optimization is to reduce the proportion of long-tail access. By dynamically adjusting the read page size and analyzing historical accesses using machine learning, pre-read pages can be properly arranged to reduce long-tail accesses with missing pages.

[0038] The main function of the memory access read sequence cache mechanism is to reduce the context switching overhead. Through the memory access read sequence cache mechanism, the process is allowed to run on the same CPU as much as possible, thereby reducing the context switching overhead. In the memory access request management:

[0039] The concurrent memory access request response mechanism allows read operations to access current data in parallel without locks, while restricting write operations, thereby improving the overall efficiency of the system;

[0040] The main purpose of application memory access feature learning and classification is to improve memory access efficiency. The memory access feature learning and classification is optimized by learning and analyzing the memory access medium type of the application. For example, applications with low latency requirements and large memory requirements can be placed in persistent memory to provide a reasonable response speed while ensuring a low page fault rate.

[0041] The persistence and demand of memory access requests are optimized by properly designing migration paths, for example, when the frequency of accessing certain data needs to be reduced, data is moved from high-speed storage to a lower-speed storage device.

[0042] According to one or more embodiments, the subsystem is assumed to be running on a prototype machine with a persistent memory and DRAM hybrid storage device, and the prototype machine has two levels of cache L1 and L2. The steps are described below in combination with the specific situation:

[0043] Step 1: When the processor needs certain data, it first searches for the data in the L1 cache. If the data is successfully hit, the data is directly returned. If the search fails, step 2 will be executed.

[0044] Step 2: Next, check the L2 cache. The specific steps are as follows:

[0045] Step 2.1: If the cache hits, the data is delivered to the L1 cache and provided to the processor.

[0046] Step 2.2: If the L2 cache misses, the processor accesses the virtual memory through the memory management unit (MMU) and executes step 3.

[0047] Step 3: The user uses a virtual address to access the memory space, where the virtual page number is A and the page offset is B. Step 4: First, the system uses a priority algorithm to determine the request with the highest priority in the request waiting queue. Step 5: The virtual page number A is hash mapped to obtain the hash value C of A, and the real physical page number is found in the hash table through C. The hash table organizes conflicting hash entries in the form of an AVL tree.

[0048] Step 5.1: If there is no physical page number corresponding to C in the hash table and the height of the AVL tree in the corresponding slot in the hash table does not exceed the defined threshold h_threshold, then add the corresponding entry to the hash table and add the corresponding page to the memory through the page fault interrupt in step 2.1. If the height exceeds h_threshold, it is necessary to delete the hash table and remove the corresponding page from DRAM, as described in step 2.2.

[0049] Step 5.1.1: After the system generates a page fault interrupt, the operating system loads the missing data page from the persistent memory into the DRAM and updates the page table entry. When the read data enters the memory, the data pre-reading strategy is used to determine whether data pre-reading is required at this time.

[0050] Step 5.1.1.1: When data pre-reading is required, sequentially read the last prefetchBlockCount data blocks of the data blocks to be read into the memory. The size of prefetchBlockCount is dynamically adjusted according to the heuristic algorithm. The specific adjustment steps are as follows:

[0051] Step 5.1.1.1.1: Prefetch prefetchBlockCount number of data blocks into the memory each time, and calculate the memory hit rate hit_rate within the t_interval time period every t_interval.

[0052] Step 5.1.1.1.2: Use the hit rate, access pattern, and current prefetchBlockCount as input to the machine learning model to incrementally train the model and derive an optimal prefetch block size prefetch_new.

[0053] Step 5.1.1.1.3: Compare |prefetch_new-prefetchBlockCount| with the threshold change_limit. If change_limit is larger, change the prefetch value to prefetch_new; otherwise, change the prefetch value to prefetchBlockCount+change_limit or prefetchBlockCount-change_limit.

[0054] Step 5.1.1.2: When updating a page table entry, first create a copy of the page table entry and make modifications to the copy. Once the modification is complete, the system updates the pointer of the page table entry from the old entry to the modified copy. During the entire process, the original page table can still be read. If it is a write access, it is necessary to wait for the current write operation to end. After the modified page table is cleared through the RCU recycling mechanism.

[0055] Step 5.1.2: When the hash page table entry is full, select the least recently used page table entry from the leaf node in the AVL tree linked to the corresponding page table entry and swap it out, thereby improving the efficiency of deletion.

[0056] Step 5.2: If the physical page number corresponding to C exists in the hash table, search it in the AVL tree in the corresponding hash entry. If the search fails, execute step 2.1. If the search is successful, the corresponding physical page number is D.

[0057] Step 6: Concatenate the physical page number and offset to get the physical address AD, and access the real memory based on AD.

[0058] Step 7: When the memory access is completed, the system collects access logs including frequently accessed data blocks and access sequence information, and loads the accessed data blocks into the L1 and L2 caches.

[0059] Step 8: Use data mining algorithms to analyze the collected log information and identify access patterns such as sequential access, random access, and periodic access, so as to perform reasonable data pre-reading and data migration.

[0060] At this point, a memory access is completed, and the memory management adopts the hash page table method, and the hash conflict is resolved by the linked balanced binary tree method. This can not only improve the speed of page number mapping, but also increase the capacity of the page table to a certain extent.

[0061] According to one or more embodiments, it is assumed that a user initiates multiple memory access requests for modifying a linked list at the same time. The steps are described as follows in conjunction with a specific device:

[0062] Step 1: At this time, the operating system is executing a read list request. Before reading the data, the foo_read_lock() function is called to register the current read task. After reading the data, foo_read_unlock() is called.

[0063] Step 1.1: If a write list request arrives at this time, perform the following steps:

[0064] Steps: 1.1.1: First, create a copy of the original linked list, and add, delete, or modify the linked list on the copy. During this process, the write operation is locked to prohibit other write operations from occurring.

[0065] Step 1.1.2: After the modification is completed, execute the synchronize_rcu() operation to monitor all read operation processes that entered the foo_read_lock() state before the modification, and wait for such processes to execute foo_read_unlock().

[0066] Step 1.1.3: Release the resources of the old linked list and replace it with the new one.

[0067] Step 1.2: If a read linked list request arrives at this time, the original linked list can be read directly.

[0068] Step 2: If the operating system is executing a write list request at this time, call the spin_lock(&foo_mutex) function to lock the write operation.

[0069] Step 2.1: If a read list request arrives at this time, execute the following steps:

[0070] Step 2.1.1: The read request is directly read on the old linked list.

[0071] Step 2.2: If a write request arrives at this time, it is necessary to wait until foo_mutex is released before making any modifications.

[0072] 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.

[0073] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A tail latency optimization system based on persistent memory, characterized in that: The system comprises: Tail latency management module, persistent memory data pre-reading module, memory access request management module, The tail delay management module is used to improve the memory management structure to reduce the tail delay; The persistent memory data pre-reading module is used to pre-read the persistent memory; The memory access request management module is used for memory access request management.

2. The system according to claim 1, characterized in that The tail delay management module includes comparison of multiple management structures and algorithms, construction of hash indexes and operation interfaces, and implementation of add, delete, modify, and query functions.

3. The system according to claim 1, characterized in that The persistent memory data pre-reading module implements functions including an RCU mechanism based on persistent memory, a pre-reading hit rate optimization mechanism, and a cache mechanism for memory access read sequences.

4. The system according to claim 1, characterized in that The memory access request management module implements functions including a response mechanism for concurrent memory access requests, an application memory access feature learning and classification mechanism, and a persistence and consistency optimization mechanism for memory access requests.

5. The system according to claim 2, characterized in that In the tail delay management module: By comparing multiple management structures and algorithms, we choose to establish hash indexes for data and build a balanced index tree for hash index conflict items, so that the worst query and deletion time is shortened to log level, thereby reducing long-tail delays.

6. The system according to claim 3, characterized in that In the persistent memory data pre-reading module: based on the RCU mechanism of persistent memory, the read operation is executed without being restricted by locks. Dynamically change the pre-read data through machine learning models.

7. The system according to claim 6, characterized in that The input data of the machine learning model are hit rate, access pattern and current pre-read data block size.

8. The system according to claim 1, characterized in that The tail delay optimization method of the system includes the following steps: Step A: Control tail latency, create a hash index for data in persistent memory, and establish an add, delete, modify, and query operation interface. Step B: Set up a pre-reading mechanism for persistent memory and use the RCU mechanism to optimize concurrent memory access requests.

9. A method for optimizing tail latency based on persistent memory, characterized in that: Based on the system as claimed in claim 1, the tail delay optimization method comprises the following steps: Step A: Control tail latency, create a hash index for data in persistent memory, and establish an add, delete, modify, and query operation interface. Step B: Set up a pre-reading mechanism for persistent memory and use the RCU mechanism to optimize concurrent memory access requests.

10. A persistent memory device, characterized in that: The persistent memory device controller runs the computer program stored therein to implement the method according to claim 9.