Cache management method and apparatus, and computer-readable storage medium

By dynamically allocating a shared memory pool in the computing cluster through a caching service process, the problem of unauthorized access between user processes is solved, memory resource isolation and efficient utilization are achieved, and IO performance is improved.

CN119718707BActive Publication Date: 2026-03-27HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-28
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

In computing clusters, there is a problem of unauthorized access to the shared memory pool by user processes, resulting in resource waste and inefficiency.

Method used

By dynamically allocating a shared memory pool through the caching service process, only specific user processes are allowed to access their dedicated memory space, thus achieving memory space isolation and on-demand allocation.

Benefits of technology

This effectively avoids unauthorized access, improves the utilization of the memory pool and the I/O performance of user processes, and achieves efficient management of memory resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119718707B_ABST
    Figure CN119718707B_ABST
Patent Text Reader

Abstract

The application provides a cache management method, which is applied to a computing cluster running a first process and a second process of a first user and a cache service process, and includes the following steps: the first process acquires a first IO request corresponding to the first process; when a first memory space (a space in a shared memory pool of the computing cluster and shared by the first process and the second process) of the first process is not enough to store data corresponding to the first IO request, the first process sends a first cache application instruction to the cache service process to apply for allocating a second memory space in the shared memory pool; the second process acquires a second IO request corresponding to the second process; when the first memory space corresponding to the second process is not enough to store data corresponding to the second IO request, the second process sends a second cache application instruction to the cache service process to apply for allocating the second memory space. The method can solve the problem of unauthorized access between processes of different users and realize dynamic allocation of the shared memory pool.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a cache management method, apparatus and computer-readable storage medium. Background Technology

[0002] Cache refers to the space in a computer system's memory used to cache disk files. The cache exchanges data with the processor before the disk, thus achieving a very fast speed. Cache settings are one of the key factors in achieving high performance in all modern computer systems.

[0003] like Figure 1 As shown, the computing cluster runs cache service processes and user processes (such as cache service processes and user processes). Figure 1 The computing cluster includes a shared memory pool, from which all user processes running on the computing cluster can request memory space as a cache. (The first process of the first user, the second process of the first user, and the process of the second user are shown.)

[0004] Currently, the typical implementation of a user process requesting memory space from a shared memory pool for caching is as follows: the user process sends a cache request instruction to the cache service process, and upon receiving the instruction, the cache service process allocates the entire shared memory pool to the user process for cache use. In other words, each user process can use the entire shared memory pool as a cache, which easily leads to unauthorized access issues between processes from different users. Summary of the Invention

[0005] This application provides a cache management method, apparatus, and computer-readable storage medium that can solve the problem of unauthorized access between processes of different users, and can also realize the dynamic allocation of shared memory pools in computing clusters.

[0006] In a first aspect, a cache management method is provided, which can be applied to a computing cluster including at least one computing device, the computing cluster running a first process and a second process of a first user and a cache service process, and the computing cluster including a shared memory pool. The method includes: the first process obtaining a first input output (IO) request corresponding to the first process; when a first memory space currently used by the first process is not enough to store data corresponding to the first IO request, the first process sending a first cache application instruction to the cache service process, the first memory space being a piece of space in the shared memory pool and being shared by the first process and the second process; the cache service process allocating a second memory space in the shared memory pool to the first process according to the first cache application instruction; the second process obtaining a second IO request corresponding to the second process; when the first memory space corresponding to the second process is not enough to store data corresponding to the second IO request, the second process sending a second cache application instruction to the cache service process; and the cache service process allocating the second memory space to the second process according to the second cache application instruction.

[0007] In the above solution, since the first memory space in the shared memory pool is only shared by the first process of the first user and the second process of the first user, and is not shared by processes of other users, the first process of the first user and the second process of the first user have the right to access data in the first memory space, while processes of other users do not have the right to access data in the first memory space, thereby avoiding unauthorized access to data in the first memory space. Similarly, since the second memory space in the shared memory pool is only shared by the first process of the first user and the second process of the first user, and is not shared by processes of other users, the first process of the first user and the second process of the first user have the right to access data in the second memory space, while processes of other users do not have the right to access data in the second memory space, thereby avoiding unauthorized access to data in the second memory space.

[0008] In addition, in the above solution, the cache service process allocates the second memory space to the first process according to the first cache application instruction sent by the first process when the first memory space currently used by the first process is not enough to store data corresponding to the first IO request, and allocates the second memory space to the second process according to the second cache application instruction sent by the second process when the first memory space corresponding to the second process is not enough to store data corresponding to the second IO request, thereby realizing dynamic allocation of the shared memory pool. It can be understood that, in the case of dynamic allocation of the shared memory pool, waste of memory pool resources can be avoided, and efficient use of memory pool resources can be realized.

[0009] In a possible implementation, the cache service process allocates the second memory space in the shared memory pool to the first process according to the first cache application instruction, including: when the cache service process determines that the frequency of the cache application instruction received from the process of the first user is higher than a frequency threshold, the cache service process allocates a plurality of second memory spaces in the shared memory pool to the first process according to the first cache application instruction. In this way, the number of times of application of the memory space by the process of the first user can be reduced.

[0010] In a possible implementation, the cache service process allocates the second memory space in the shared memory pool to the first process according to the first cache application instruction, including: the cache service process allocates the second memory space in the shared memory pool to the first process according to the first capacity carried in the first cache application instruction, and the capacity of the second memory space is the first capacity. In this way, the memory space in the shared memory pool can be allocated on demand according to the demand of the user process.

[0011] In order to improve the flexibility of the scheme, in a possible implementation, the capacity of the second memory space is a fixed capacity.

[0012] In a possible implementation, the first memory space is shared by the first process, the second process, and the cache service process.

[0013] By implementing the above implementation, the cache service process can assist the first process / second process to perform the IO operation through the first memory space, that is, the cache service process reads the IO data corresponding to the first process / second process from the disk to the first memory space, or the cache service process writes the IO data corresponding to the first process / second process from the first memory space to the disk for persistent storage, so as to improve the IO performance of the user process.

[0014] In a possible implementation, the method further includes: after the cache service process stores full data in the first memory space, the cache service process stores the data in the first memory space to the disk of the computing cluster; and the cache service process releases the first memory space shared by the first process, the second process, and the cache service process. In this way, the memory space in the shared memory pool can be recycled and efficiently utilized.

[0015] In a possible implementation, the cache service process releases the first memory space shared by the first process, the second process, and the cache service process, including: when the cache service process determines that the usage heat of the memory space in the namespace of the first user is lower than a heat threshold, the cache service process releases the first memory space shared by the first process, the second process, and the cache service process, wherein the namespace of the first user includes the memory space allocated to the first process and the memory space allocated to the second process in the shared memory pool.

[0016] It can be understood that the usage of the memory space in the namespace of the first user is higher than or equal to the heat threshold, which indicates that the usage of the memory space in the namespace of the first user is relatively high. In this case, the cache service process does not release the first memory space shared by the first process, the second process and the cache service process, and the frequency of the first user's process applying for the memory space can be reduced.

[0017] In a possible implementation, the cache service process releases the first memory space shared by the first process, the second process and the cache service process, including: the cache service process generates marking information, the marking information indicating that the first memory space is unavailable; the cache service process sends the marking information to the first process, the marking information being used for the first process to release the first memory space corresponding to the first process; the cache service process sends the marking information to the second process, the marking information being used for the second process to release the first memory space corresponding to the second process; and the cache service process releases the first memory space corresponding to the cache service process.

[0018] In a possible implementation, the first process, the second process and the cache service process run on the same computing device or different computing devices in the computing cluster.

[0019] In a second aspect, a cache management apparatus is provided, and is applied to a computing cluster including at least one computing device, the computing cluster running a first process and a second process of a first user and a cache service process, and the computing cluster including a shared memory pool. The apparatus includes:

[0020] The obtaining module is configured to obtain, by the first process, a first IO request corresponding to the first process.

[0021] The sending module is configured to, when a current first memory space of the first process is not enough to store data corresponding to the first IO request, send, by the first process, a first cache application instruction to the cache service process, the first memory space being a piece of space in the shared memory pool and being shared by the first process and the second process.

[0022] The memory allocation module is configured to, according to the first cache application instruction, allocate, by the cache service process, a second memory space in the shared memory pool to the first process.

[0023] The obtaining module is further configured to obtain, by the second process, a second IO request corresponding to the second process.

[0024] The sending module is further configured to, when the first memory space corresponding to the second process is not enough to store data corresponding to the second IO request, send, by the second process, a second cache application instruction to the cache service process.

[0025] The memory allocation module is further configured to allocate, by the cache service process, the second memory space to the second process according to the second cache application instruction.

[0026] In a possible implementation, the memory allocation module is specifically configured to:

[0027] allocate, by the cache service process, a plurality of second memory spaces in the shared memory pool to the first process according to the first cache application instruction when it is determined that the frequency of the received cache application instruction from the process of the first user is higher than a frequency threshold.

[0028] In a possible implementation, the memory allocation module is specifically configured to:

[0029] allocate, by the cache service process, a second memory space in the shared memory pool to the first process according to the first capacity carried by the first cache application instruction, the capacity of the second memory space being the first capacity.

[0030] In a possible implementation, the capacity of the second memory space is a fixed capacity.

[0031] In a possible implementation, the first memory space is shared by the first process, the second process and the cache service process.

[0032] In a possible implementation, the apparatus further includes a memory release module.

[0033] The memory release module is configured to:

[0034] store, by the cache service process, data in the first memory space to a disk of the computing cluster after the first memory space is full of data;

[0035] release, by the cache service process, the first memory space shared by the first process, the second process and the cache service process.

[0036] In a possible implementation, the memory release module is specifically configured to:

[0037] release, by the cache service process, the first memory space shared by the first process, the second process and the cache service process when it is determined that the usage heat of the memory space in the namespace of the first user is lower than a heat threshold, wherein the namespace of the first user includes the memory space allocated to the first process and the memory space allocated to the second process in the shared memory pool.

[0038] In a possible implementation, the memory release module is specifically configured to:

[0039] generating, by the cache service process, mark information, the mark information indicating that the first memory space is unavailable;

[0040] sending, by the cache service process, the mark information to the first process, the mark information being used for the first process to release the first memory space corresponding to the first process;

[0041] sending, by the cache service process, the mark information to the second process, the mark information being used for the second process to release the first memory space corresponding to the second process;

[0042] releasing, by the cache service process, the first memory space corresponding to the cache service process.

[0043] In a possible implementation, the first process, the second process and the cache service process run on the same computing device or different computing devices in the computing cluster.

[0044] The cache management apparatus provided in the second aspect and the related advantages and descriptions of any of the implementation manners of the second aspect can refer to the advantages and descriptions of the foregoing first aspect and any of the implementation manners of the first aspect, which will not be described herein.

[0045] In a third aspect, a computing cluster is provided, the computing cluster comprising at least one computing device, each of the at least one computing device comprising a processor and a memory; the processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, so that the computing cluster implements the method provided in the foregoing first aspect or any possible implementation manner of the first aspect.

[0046] In a fourth aspect, a computer readable storage medium is provided, the computer readable storage medium storing instructions for implementing the method provided in the foregoing first aspect or any possible implementation manner of the first aspect.

[0047] In a fifth aspect, a computer program product is provided, comprising a computer program, when the computer program is read and executed by a computing device, causing the computing device to execute the method provided in the foregoing first aspect or any possible implementation manner of the first aspect. BRIEF DESCRIPTION OF DRAWINGS

[0048] Figure 1 is a structural schematic diagram of a computing cluster provided by an embodiment of the present application;

[0049] Figure 2 is an interaction schematic diagram of a cache management method provided by an embodiment of the present application;

[0050] Figure 3 is a schematic diagram of implementing memory space isolation in a shared resource pool provided by an embodiment of the present application;

[0051] Figure 4 is a schematic diagram of marking a cache block as unavailable by a cache service process provided by an embodiment of the present application;

[0052] Figure 5 is a schematic diagram of a local cache application first and a remote cache application second provided by an embodiment of the present application;

[0053] Figure 6 is a structural schematic diagram of a cache management apparatus provided by an embodiment of the present application;

[0054] Figure 7 is a structural schematic diagram of a computing device provided by an embodiment of the present application;

[0055] Figure 8 is a structural schematic diagram of a computing cluster provided by an embodiment of the present application. DETAILED DESCRIPTION

[0056] The technical solutions provided by the present application will be described below with reference to the accompanying drawings.

[0057] First, the application scenario of the present application is introduced.

[0058] Referring to Figure 1 , Figure 1 is a structural schematic diagram of a computing cluster provided by an embodiment of the present application, as shown in Figure 1 , the user space of the computing cluster runs a cache service process and processes of multiple users, and in Figure 1 , the processes of multiple users are taken as the processes of a first user and the processes of a second user as examples, wherein the processes of the first user include a first process of the first user and a second process of the first user.

[0059] The computing cluster can include at least one computing device, which can be a personal computer, a notebook computer, a physical server, or a cloud server, etc. When the computing cluster includes multiple computing devices, the multiple computing devices can be connected through a communication network of any communication mechanism / communication standard. The communication network can be a wide area network, a local area network, a point-to-point connection, etc., or any combination thereof.

[0060] When a computing cluster includes multiple computing devices, the aforementioned cache service process, the first user's process, and the second user's process can run on the same computing device or different computing devices in the computing cluster. For example, multiple computing devices include computing device A and computing device B. The cache service process, the first user's first process, and the first user's second process run on computing device A, while the second user's process runs on computing device B.

[0061] like Figure 1 As shown, the kernel space of the computing cluster has a shared memory pool, from which all user processes running on the computing cluster can request memory space as a cache. When the computing cluster includes a single computing device, the shared memory pool can be part or all of the memory of that single computing device. When the computing cluster includes multiple computing devices, the shared memory pool can be a global memory consisting of part or all of the memory of the multiple computing devices.

[0062] Currently, the typical implementation process for a user process to request memory space from a shared memory pool for caching is as follows: the user process sends a cache request instruction to the cache service process. Upon receiving the cache request instruction, the cache service process allocates the entire shared memory pool to the user process for cache use. In other words, each user process can use the entire shared memory pool as a cache.

[0063] With the help of the shared memory pool, user processes only need to access the shared memory pool to read and write IO data when they need to perform input / output (I / O) operations. The process of reading the IO data required by the user process from the shared memory pool and writing the IO data written by the user process to the disk are both implemented by the caching service process. User processes do not need to access the disk for data reading and writing, thereby improving the IO performance of user processes.

[0064] It should be understood that Figure 1 The computing cluster shown is merely an example. In a specific implementation, the computing cluster can also run other user processes besides the first process of the first user, the second process of the first user, and the process of the second user. The computing cluster can also include other or more component modules, which are not specifically limited in this application.

[0065] exist Figure 1 In the computing cluster shown, since the cache service process allocates the entire shared memory pool to different user processes, when the first user's process puts its own IO data into the shared memory pool, the second user's process can also access the shared memory pool and thus obtain the IO data of the first user's process, which can easily lead to unauthorized access issues.

[0066] To solve the above problems, the application provides a cache management method and a cache management device, which can not only realize that different user processes can access the IO data of other user processes in the shared memory pool without permission when using the shared memory pool, but also realize dynamic allocation of the shared memory pool and efficient use of the shared memory pool.

[0067] The cache management method provided by the application will be introduced below in combination with the computing cluster shown in Figure 1 and the flow chart shown in Figure 2 The cache management method provided by the application will be introduced below in combination with the computing cluster shown in Figure 2 , Figure 2 is a flow diagram of a cache management method provided by an embodiment of the application, and specifically includes the following steps:

[0068] S201: The cache service process allocates a first memory space in the shared memory pool for the first process and the second process to share to the first process and the second process.

[0069] S202: The first process obtains a first IO request corresponding to the first process.

[0070] S203: When the current first memory space of the first process is not enough to store the data corresponding to the first IO request, the first process sends a first cache application instruction to the cache service process.

[0071] S204: After receiving the first cache application instruction sent by the first process, the cache service process allocates a second memory space in the shared memory pool to the first process according to the first cache application instruction.

[0072] S205: The second process obtains a second IO request corresponding to the second process.

[0073] S206: When the first memory space corresponding to the second process is not enough to store the data corresponding to the second IO request, the second process sends a second cache application instruction to the cache service process.

[0074] S207: After receiving the second cache application instruction sent by the second process, the cache service process allocates the second memory space to the second process according to the second cache application instruction.

[0075] Firstly, the concepts of the IO request (such as the first IO request and the second IO request), the data corresponding to the IO request, and the cache service process allocating the memory space in the shared memory pool to the user process involved in the embodiments of the application will be introduced.

[0076] In the embodiments of the present application, the IO request is used to instruct the user process to perform an IO operation, specifically, it can be a read / write data request (which can be referred to as a read / write request) of the user process to the disk of the computing cluster, used to read IO data from the disk into the memory space (i.e., the cache of the user process) allocated to the user process, or write IO data into the memory space allocated to the user process, and then write the IO data from the memory space allocated to the user process into the disk for persistent storage.

[0077] When the IO request is a read request, the data corresponding to the IO request is the data that the user process needs to read from the disk, and when the IO request is a write request, the data corresponding to the IO request is the data that the user process needs to write into the disk. In the following embodiments, the data corresponding to the IO request is collectively referred to as IO data.

[0078] In the embodiments of the present application, the cache service process allocates a first memory space in the shared memory pool to the first process, the cache service process allocates the first memory space in the shared memory pool to the second process, the cache service process allocates a second memory space in the shared memory pool to the first process, and the cache service process allocates the second memory space in the shared memory pool to the second process. Taking the allocation of the first memory space in the shared memory pool to the first process by the cache service process as an example, the cache service process can send the address of the first memory space to the first process, and the address of the first memory space is used to establish a mapping relationship between the virtual address space of the first process and the first memory space. After the mapping relationship is established, the first process can read and write the first memory space according to the mapping relationship. Processes that are not allocated the first memory space cannot perform IO operations through the first memory space.

[0079] Alternatively, the cache service process can also establish a mapping relationship between the virtual address space of the cache service process and the first memory space. After the mapping relationship is established, the first memory space shared by the cache service process and the first process is formed, and the cache service process can assist the first process to perform IO operations through the first memory space, i.e., the cache service process reads the IO data corresponding to the first process from the disk into the first memory space, or the cache service process writes the IO data corresponding to the first process from the first memory space into the disk for persistent storage.

[0080] In the embodiments of the present application, the first process and the second process share the first memory space, the first process and the second process share the second memory space, and the first process, the second process and the cache service process share the first memory space. Taking the first process and the second process sharing the first memory space as an example, the first process and the second process share the first memory space, that is, the first process and the second process are both allocated the first memory space as cache, and the first process and the second process both establish mapping relationship between their own virtual address space and the first memory space, so that the first process and the second process can perform IO operation through the first memory space. The process which does not share the first memory space cannot perform IO operation through the first memory space.

[0081] In the embodiments of the present application, if the process of the first user except the first process and the second process wants to share the first memory space, the cache service process needs to send a cache application instruction, the cache service process determines that the process is also the process of the first user, and then allocates the first memory space to the process according to the cache application instruction, so that the process also shares the first memory space. For the process of the second user except the process of the first user, when the cache service process sends a cache application instruction, the cache service process determines that the process is not the process of the first user, and then allocates other memory space in the shared memory pool except the first memory space to the process of the second user according to the cache application instruction.

[0082] It can be seen that through the above process, the isolation of the memory space in the shared memory pool allocated by the processes of different users can be realized, so that the problem of unauthorized access between the processes of different users can be avoided.

[0083] In a possible embodiment, if the cache service process creates the namespace of the first user before sending the address of the first memory space to the first process, the namespace is a resource isolation scheme for user-level resource isolation. The cache service process creates different namespaces for different users, and when allocating the memory space in the shared memory pool to the process of each user, the cache service process adds the memory space allocated to the process of the user to the namespace of the user first. Each user's process can access the memory space in each user's own namespace, but cannot access the memory space in other user's namespace. The cache service process adds the memory space allocated to the process of the user to the namespace of the user, which can be understood as making the memory space allocated to the process of the user a member of the namespace of the user. For example, Figure 3As shown, the first memory space allocated for the first process of the first user and the second memory space are both members of the namespace of the first user, and the third memory space allocated for the process of the second user and the fourth memory space are both members of the namespace of the second user, so as to realize the isolation of the memory space resources in the shared memory pool corresponding to different users.

[0084] Based on the above, the following will be described in detail. Figure 2 The various steps shown will be described in detail.

[0085] In S201, the cache service process allocates the first memory space in the shared memory pool for the first process and the second process to share. For specific implementation process, please refer to the relevant description above. In order to make the description simple, it will not be expanded here.

[0086] In S202 and S205, the first IO request and the second IO request, and in S203 and S206, the data corresponding to the first IO request and the data corresponding to the second IO request, please refer to the relevant description above. In order to make the description simple, it will not be expanded here.

[0087] In S207, after receiving the second cache application instruction sent by the second process, the cache service process can first judge whether there is unallocated memory space in the memory space allocated by the first process for the second process. If it is judged that there is unallocated memory space in the memory space allocated by the first process for the second process, the unallocated memory space is allocated to the second process. For example, the first memory space allocated to the first process has been allocated to the second process, and the second memory space allocated to the first process has not been allocated to the second process. Then the second memory space is allocated to the second process. Otherwise, according to the second cache application instruction, a piece of space in the remaining memory space in the shared memory pool is allocated to the second process.

[0088] In S204, the cache service process allocates the second memory space in the shared memory pool to the first process, and in S207, the cache service process allocates the second memory space to the second process. For specific implementation process, please refer to the relevant description above. In order to make the description simple, it will not be expanded here.

[0089] It should be noted that the first memory space can be a piece of memory space with continuous address in the shared memory pool, or a piece of memory space with discontinuous address. The second memory space can be a piece of memory space with continuous address in the shared memory pool, or a piece of memory space with discontinuous address. The present application does not make specific limitation on this.

[0090] In specific embodiments of the present application, the size of the memory space (e.g., the second memory space) allocated by the cache service process to the user process (e.g., the first process) according to the cache application instruction (e.g., the first cache application instruction) sent by the user process can be as follows:

[0091] ① The size of the memory space allocated by the cache service process each time is fixed.

[0092] ② The cache service process allocates memory space according to user demand, that is, the cache application instruction sent by the user process carries the capacity of the memory space to be applied, and the cache service process allocates memory space in the shared pool to the user process according to the capacity of the memory space to be applied carried by the cache application instruction. The capacity of the allocated memory space is the same as the capacity of the memory space to be applied carried by the cache application instruction.

[0093] It should be understood that the above-mentioned mode ① and mode ② are only examples and should not be regarded as a limitation on the implementation mode of the cache service process allocating memory space according to the first cache application instruction.

[0094] In a possible embodiment, when the cache service process receives the first cache application instruction sent by the first process, it can count the frequency of the cache application instructions received from the processes of the first user (referring to all processes of the first user), and determine whether the frequency is higher than a frequency threshold. When it is determined that the frequency is higher than the frequency threshold, the cache service process allocates multiple second memory spaces in the shared memory pool to the first process according to the first cache application instruction. When it is determined that the frequency is lower than or equal to the frequency threshold, the cache service process allocates one second memory space in the shared memory pool to the first process according to the first cache application instruction. In this way, the number of times of applying for memory space by the processes of the first user can be reduced.

[0095] In specific embodiments of the present application, the cache service process can also store the data in the first memory space / second memory space to the disk of the computing cluster after the first memory space / second memory space is full of data, for persistent storage. Then, the cache service process releases (recycles) the first memory space / second memory space shared by the first process, the second process, and / or the cache service process, thereby realizing the cyclic and efficient utilization of the memory space in the shared memory pool.

[0096] Taking the release of the first memory space shared by the first process, the second process, and the cache service process by the cache service process as an example, in a possible embodiment, the cache service process releases the first memory space shared by the first process, the second process, and the cache service process immediately after storing the data in the first memory space to the disk of the computing cluster.

[0097] In another possible embodiment, if the cache service process is implemented by creating a user-level namespace for different users to achieve resource isolation of the memory space in the shared memory pool available to the processes of different users, the cache service process can determine whether the usage heat of the memory space in the namespace of the first user is lower than a heat threshold after storing the data in the first memory space into the disk of the computing cluster, and release the first memory space shared by the process, the second process and the cache service process if it is determined that the usage heat is lower than the heat threshold, otherwise, the first memory space shared by the process, the second process and the cache service process is not released. The usage heat of the memory space in the namespace of the first user can be reflected by the frequency of use or the turnover rate.

[0098] It can be understood that the usage heat of the memory space in the namespace of the first user is higher than or equal to the heat threshold, which means that the usage heat of the memory space in the namespace of the first user is high. In this case, the cache service process does not release the first memory space shared by the process, the second process and the cache service process, which can reduce the frequency of the process of the first user applying for memory space.

[0099] Further, the specific process of the cache service process releasing the first memory space shared by the process, the second process and the cache service process can be that the cache service process generates marking information indicating that the first memory space is unavailable, then the cache service process sends the marking information to the first process, the marking information is used for the first process to release the first memory space corresponding to the first process, and sends the marking information to the second process, the marking information is used for the second process to release the first memory space corresponding to the second process, and then the cache service process also releases the first memory space corresponding to the cache service process. The above-mentioned first process / second process / cache service process releasing the first memory space corresponding to itself means that the first process / second process / cache service process releases the mapping relationship between the virtual address space of itself and the first memory space.

[0100] Further, taking the cache service process sending the marking information to the first process as an example, the cache service process can send the marking information to the first process by the following way 1 or way 2.

[0101] Way 1, the cache service process receives the acquisition request for the marking information corresponding to the first memory space periodically sent by the first process, and returns the marking information to the first process according to the acquisition request.

[0102] Specifically, the cache service process can query whether there is the marking information corresponding to the first memory space according to the acquisition request, and return the marking information corresponding to the first memory space to the first process if it is determined that there is the marking information corresponding to the first memory space.

[0103] Optionally, the cache service process can also send the marking information to the first process directly after generating the marking information.

[0104] In mode 2, the cache service process adds the marking information in the first memory space, and the first process can obtain the marking information when accessing the first memory space. As shown in Figure 4 , the cache service process adds the marking information in the first memory space (as the memory space 2). Figure 4

[0105] In a specific implementation, if there is a process (for example, the first process) in the first user's process that has not released the first memory space corresponding to the first process, and the cache service process releases the first memory space corresponding to the cache service process first, if the first process accesses the first memory space corresponding to the first process again, the IO data corresponding to the first process cannot be stored persistently to the disk, and even the first process can crash. In order to avoid the above situation, the cache service process can release the first memory space corresponding to the cache service process when it is determined that all user processes (i.e., the first process and the second process) sharing the first memory space release their corresponding first memory spaces.

[0106] In a possible embodiment, if the cache service process sends the marking information to the first process and the second process sharing the first memory space by the above-mentioned mode 1, the cache service process can start timing from the time when it last receives the obtaining request from the first user's process, and when the timing reaches the first time length, it is determined that the first process and the second process release their corresponding first memory spaces. It can be understood that the timing of the cache service process starting from the time when it last receives the obtaining request from the first user's process reaching the first time length indicates that the first process and the second process have not sent the obtaining request to the cache service process for a long time, which usually indicates that the first process and the second process have released their first memory spaces.

[0107] The first time length can be customized according to actual scenarios, for example, the cache service process can set a period, and when the cache service process has waited for a certain number of periods after last receiving the obtaining request from the first user's process, it is determined that the first process and the second process release their corresponding first memory spaces.

[0108] Optionally, the first process / second process can send a notification to the cache service process after releasing the first memory space corresponding to the first process / second process, indicating that the first memory space corresponding to the first process / second process has been released.

[0109] ​In practical implementation, if the caching service process achieves memory space resource isolation in the shared memory pool accessible to different user processes by creating user-level namespaces for different users, taking the release of the first memory space corresponding to the first process as an example, the first process can clear the first memory space in the namespace of the first user within the first process and unmap the virtual address space of the first process from the first memory space. The process of the second process releasing the first memory space corresponding to the second process, and the process of the caching service process releasing the first memory space corresponding to the caching service process, are similar to the process of the first process releasing the first memory space corresponding to the first process, and will not be elaborated further here.

[0110] When multiple processes share the same memory space, taking the first process and the second process sharing the first memory space as an example, in order to ensure safe access to the first memory space and avoid resource contention and data inconsistency, a synchronization mechanism (such as locking) can be used to protect the first memory space, ensuring that only one process can access the first memory space at a time.

[0111] When a computing cluster includes multiple computing devices and the shared memory pool of the computing cluster consists of memory from multiple computing devices, when the cache service process receives the first cache request instruction from the first process, the cache service process can search for free memory space in the shared memory pool and allocate it to the first process based on the principle of local first and remote second.

[0112] The principle of prioritizing local devices over remote devices, for example, is as follows: Figure 5 As shown, assuming the first process is performed by computing device A, and the computing cluster also includes computing device B, and the shared memory pool consists of the memory of computing device A and the memory of computing device B, then computing device A is the local device for the first process, and computing device B is the remote device for the first process. When the memory service process allocates the first memory space to the first process, it first determines whether there is free memory space available for allocation in the memory of computing device A. If there is, it allocates directly from the memory of computing device A. If not, it then accesses computing device B to determine whether there is free memory space available for allocation in the memory of computing device B.

[0113] In one possible embodiment, the aforementioned computing cluster can be a high-performance computing (HPC) cluster. HPC refers to a computing system and environment that uses multiple processors of the same computing device or multiple computing devices in a cluster to perform complex computational processing.

[0114] It should be noted that in the above embodiments, the processes of the first user include two processes of the first process and the second process as an example for description, and in the specific implementation, the processes of the first user can include more processes, and when the processes of the first user include more processes, the manner in which the more processes use the shared memory pool is similar to the manner in which the first process and the second process use the shared memory pool, and for the sake of brevity of the description, the details are not described herein.

[0115] It can be known from the above embodiments that in the cache management method provided in the application, since the first memory space in the shared memory pool is shared only by the first process of the first user and the second process of the first user, and is not shared by the processes of other users, the first process of the first user and the second process of the first user have the right to access the data in the first memory space, and the processes of other users do not have the right to access the data in the first memory space, thereby avoiding the data in the first memory space from being accessed by unauthorized users. Similarly, since the second memory space in the shared memory pool is shared only by the first process of the first user and the second process of the first user, and is not shared by the processes of other users, the first process of the first user and the second process of the first user have the right to access the data in the second memory space, and the processes of other users do not have the right to access the data in the second memory space, thereby avoiding the data in the second memory space from being accessed by unauthorized users.

[0116] In addition, in the above scheme, since the cache service process allocates the second memory space to the first process according to the first cache application instruction sent by the first process when the current first memory space of the first process is not enough to store the data corresponding to the first IO request, and allocates the second memory space to the second process according to the second cache application instruction sent by the second process when the first memory space corresponding to the second process is not enough to store the data corresponding to the second IO request, the dynamic allocation of the shared memory pool is realized. It can be understood that in the case of dynamic allocation of the shared memory pool, the waste of memory pool resources can be avoided, and the efficient use of memory pool resources can be realized.

[0117] It should be understood that the above Figure 2 The size of the serial number of each step in the embodiments shown does not mean the order of execution, and the execution order of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the application.

[0118] Next, the cache management apparatus provided by the present application is introduced. It should be understood that the unit modules inside the cache management apparatus can also be divided in multiple ways. Each module can be a software module, a hardware module, or a combination of software and hardware modules. The present application does not limit the modules. When the cache management apparatus includes multiple unit modules, each module in the multiple unit modules can be deployed on the same computing device (such as a server) or on different computing devices. The present application does not make specific limitations.

[0119] Referring to Figure 6 , Figure 6 is a structural schematic diagram of a cache management apparatus 600 provided by an embodiment of the present application. The apparatus 600 can be applied to Figure 1 a computing cluster including at least one computing device, as shown in Figure 6 The apparatus 600 includes an obtaining module 610, a sending module 620, and a memory allocation module 630.

[0120] The functions of each module of the cache management apparatus 600 are described below. It should be understood that the functions of each module described below are only examples of the functions that the cache management apparatus 600 can have in some embodiments of the present application. The present application does not limit the functions of each module.

[0121] The obtaining module 610 is configured to obtain, by a first process, a first IO request corresponding to the first process.

[0122] The sending module 620 is configured to send, by the first process, a first cache application instruction to a cache service process when a first memory space currently used by the first process is not enough to store data corresponding to the first IO request. The first memory space is a segment of space in a shared memory pool and is shared by the first process and a second process.

[0123] The memory allocation module 630 is configured to allocate, by the cache service process, a second memory space in the shared memory pool to the first process according to the first cache application instruction.

[0124] The obtaining module 610 is further configured to obtain, by a second process, a second IO request corresponding to the second process.

[0125] The sending module 620 is further configured to send, by the second process, a second cache application instruction to the cache service process when a first memory space corresponding to the second process is not enough to store data corresponding to the second IO request.

[0126] The memory allocation module 630 is further configured to allocate, by the cache service process, the second memory space to the second process according to the second cache application instruction.

[0127] In some possible embodiments, the memory allocation module 630 is specifically configured to:

[0128] allocate, by the cache service process, the plurality of second memory spaces in the shared memory pool to the first process according to the first cache application instruction, when it is determined that the frequency of the received cache application instruction from the first process is higher than a frequency threshold.

[0129] In some possible embodiments, the memory allocation module 630 is specifically configured to:

[0130] allocate, by the cache service process, the second memory space in the shared memory pool to the first process according to the first capacity carried by the first cache application instruction, the second memory space having the first capacity.

[0131] In some possible embodiments, the second memory space has a fixed capacity.

[0132] In some possible embodiments, the first memory space is shared by the first process, the second process and the cache service process.

[0133] In some possible embodiments, as shown in FIG. 6, Figure 6 the apparatus 600 further includes a memory release module 640;

[0134] The memory release module 640 is configured to:

[0135] store, by the cache service process, the data in the first memory space to a disk of the computing cluster when the first memory space is full of data;

[0136] release, by the cache service process, the first memory space shared by the first process, the second process and the cache service process.

[0137] In some possible embodiments, the memory release module 640 is specifically configured to release, by the cache service process, the first memory space shared by the first process, the second process and the cache service process, when the usage heat of the memory space in the namespace of the first user is lower than a heat threshold, wherein the namespace of the first user includes the memory space allocated to the first process and the memory space allocated to the second process in the shared memory pool.

[0138] In some possible embodiments, the memory release module 640 is specifically configured to:

[0139] generate, by the cache service process, the marking information, the marking information indicating that the first memory space is unavailable;

[0140] send, by the cache service process, the marking information to the first process, the marking information being used by the first process to release the first memory space corresponding to the first process;

[0141] The cache service process sends the marking information to the second process, and the marking information is used for the second process to release the first memory space corresponding to the second process.

[0142] The cache service process releases the first memory space corresponding to the cache service process.

[0143] In some possible embodiments, the first process, the second process, and the cache service process run on the same computing device or different computing devices in the computing cluster.

[0144] Specifically, the specific implementation of the cache management apparatus 600 performing various operations can refer to the specific implementation of the cache management method provided by the application as described above. Figure 2 The cache management method provided by the application is not described again here for the sake of brevity of the description.

[0145] In a specific implementation, the obtaining module 610, the sending module 620, the memory allocation module 630, and the memory release module 640 can be implemented by software or by hardware. For example, the implementation of the sending module 620 is described below. Similarly, the implementation of the obtaining module 610, the memory allocation module 630, and the memory release module 640 can refer to the implementation of the sending module 620.

[0146] As an example of a software functional unit, the sending module 620 can include code running on a computing instance. The computing instance can include at least one of a physical host (computing device), a virtual machine, and a container. Further, the computing instance can be one or more. For example, the sending module 620 can include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code can be distributed in the same region (region) or in different regions. Further, the multiple hosts / virtual machines / containers used to run the code can be distributed in the same availability zone (AZ) or in different AZs, and each AZ includes one data center or multiple data centers with similar geographical locations. Generally, one region can include multiple AZs.

[0147] Similarly, the multiple hosts / virtual machines / containers used to run the code can be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Generally, one VPC is set in one region, and a communication gateway needs to be set in each VPC for cross-region communication between two VPCs in the same region or between VPCs in different regions, and the interconnection between VPCs is realized through the communication gateway.

[0148] As an example of a hardware functional unit, the sending module 620 can include at least one computing device, such as a server or the like. Alternatively, the sending module 620 can also be a device implemented by an application-specific integrated circuit (ASIC) or a programmable logic device (PLD), and the like. The PLD can be implemented by a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0149] When the sending module 620 includes multiple computing devices, the multiple computing devices included in the sending module 620 can be distributed in the same region or in different regions. The multiple computing devices included in the sending module 620 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the sending module 620 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.

[0150] It should be noted that in other embodiments, the sending module 620 can be configured to perform any of the steps performed by the first process, the second process, and the cache service process in the cache management processing method shown in the above. Figure 2 The obtaining module 610 can be configured to perform any of the steps performed by the first process, the second process, and the cache service process in the cache management processing method shown in the above. Figure 2 The memory allocation module 630 can be configured to perform any of the steps performed by the first process, the second process, and the cache service process in the cache management processing method shown in the above. Figure 2 The memory release module 640 can be configured to perform any of the steps performed by the first process, the second process, and the cache service process in the cache management processing method shown in the above. Figure 2 The memory release module 640 can be configured to perform any of the steps performed by the first process, the second process, and the cache service process in the cache management processing method shown in the above.

[0151] The steps implemented by the obtaining module 610, the sending module 620, the memory allocation module 630, and the memory release module 640 can be specified as needed, and the cache management processing method can be implemented by the obtaining module 610, the sending module 620, the memory allocation module 630, and the memory release module 640 respectively implementing Figure 2 the different steps in the cache management processing method shown in the above.

[0152] This application embodiment also provides a computing device that can be deployed... Figure 6 The cache management device 600 is shown. See also... Figure 7 ,like Figure 7 As shown, the computing device 700 includes a processor 710, a memory 720, and a communication interface 730, wherein the processor 710, the memory 720, and the communication interface 730 can be interconnected via a bus 740.

[0153] The processor 710 can read program code (including instructions) stored in the memory 720, execute the program code stored in the memory 720, and cause the computing device 700 to perform... Figure 2 The cache management method provided in this application is shown, or it enables the computing device 700 to deploy a cache management device 600.

[0154] The processor 710 can be implemented in various ways, such as a central processing unit (CPU) or a combination of a CPU and hardware chips. The hardware chips can be application-specific integrated circuits (ASICs), programmable logic devices (PLDs), or combinations thereof. The PLDs can be complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), generic array logic (GALs), or any combination thereof. The processor 710 executes various types of digital storage instructions, such as software or firmware programs stored in memory 720, enabling the computing device 700 to provide a variety of services.

[0155] The memory 720 stores program code and is executed under the control of the processor 710. The program code may include one or more software modules, which can be... Figure 6 The software modules provided in the illustrated embodiment include the code for the acquisition module 610, the code for the sending module 620, the code for the memory allocation module 630, and the code for the memory release module 640.

[0156] The memory 720 can include volatile memory (e.g., random access memory (RAM)), storage device (e.g., a magnetic disk, an optical disk, a tape, etc.), flash memory, or a combination thereof. The memory 720 can include a combination of memory devices based on a desired embodiment.

[0157] The communication interface 730 can be a wired interface (e.g., an Ethernet interface, a fiber optic interface, other types of interfaces (e.g., an infiniBand interface), or a wireless interface (e.g., a cellular network interface or a wireless local area network interface) for communicating with other computing devices or apparatuses. The communication interface 730 can employ a family of protocols above the transmission control protocol / internet protocol (TCP / IP), such as a remote function call (RFC) protocol, a simple object access protocol (SOAP) protocol, a simple network management protocol (SNMP) protocol, a common object request broker architecture (CORBA) protocol, a distributed protocol, and the like.

[0158] Bus 740 can be a Peripheral Component Interconnect Express (PCIe) bus, an Extended Industry Standard Architecture (EISA) bus, a Unified Bus (Ubus or UB), a Compute Express Link (CXL) bus, a Cache Coherent Interconnect for Accelerators (CCIX) bus, etc. Bus 740 can be divided into address bus, data bus, control bus, etc. In addition to the data bus, bus 740 can also include power bus, control bus, and status signal bus. However, for clarity, all buses are labeled as bus 740 in the diagram. For ease of representation, Figure 7 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0159] The computing device 700 described above can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device 700 can also be a terminal device such as a desktop computer or a laptop computer.

[0160] The aforementioned computing device 700 is used to execute Figure 2 The cache management method provided in this application is described in detail in the above method embodiments, and will not be repeated here.

[0161] It should be understood that the computing device 700 is merely one example provided in the embodiments of this application, and the computing device 700 may have more than Figure 7 The components shown may have more or fewer components, two or more components may be combined, or different configurations of components may be implemented.

[0162] This application embodiment also provides a computing cluster that can be deployed... Figure 6 The cache management device 600 shown above implements the operations and / or functions of each module in the computing cluster for the purpose of... Figure 2 The corresponding steps in the cache management method shown.

[0163] See Figure 8 ,like Figure 8 As shown, the computing cluster 800 includes at least one computing device 700. The memory 720 of one or more computing devices 700 in the computing cluster 800 may store the same memory for executing... Figure 2 The instructions for the cache management method are shown.

[0164] In some possible implementation manners, the memory 720 of one or more computing devices 700 in the computing cluster 800 can also respectively store part of instructions of the cache management method shown. In other words, the combination of one or more computing devices 700 can jointly execute instructions for executing the cache management method shown. Figure 2 In some possible implementation manners, the memory 720 of one or more computing devices 700 in the computing cluster 800 can also respectively store part of instructions of the cache management method shown. In other words, the combination of one or more computing devices 700 can jointly execute instructions for executing the cache management method shown. Figure 2 In some possible implementation manners, the memory 720 of one or more computing devices 700 in the computing cluster 800 can also respectively store part of instructions of the cache management method shown. In other words, the combination of one or more computing devices 700 can jointly execute instructions for executing the cache management method shown.

[0165] It should be noted that the memory 720 in different computing devices 700 in the computing cluster 800 can store different instructions, respectively used to execute part of the functions of the cache management apparatus 600. That is, the instructions stored in the memory 720 in different computing devices 700 can implement the functions of one or more of the obtaining module 610, the sending module 620, the memory allocation module 630, and the memory release module 640.

[0166] The embodiments of the present application further provide a computer readable storage medium, which stores instructions. The instructions can implement part or all of the steps of the cache management method described in the above embodiments when the instructions are executed.

[0167] The embodiments of the present application further provide a computer program product. When the computer program product is read and executed by a computer, part or all of the steps of the cache management method described in the above method embodiments can be implemented.

[0168] In the above embodiments, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.

[0169] In the above embodiments, all or part of the embodiments can be implemented by software, hardware or any combination thereof. When implemented by software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions can be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.). The computer readable storage medium can be any available medium accessible by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media. The available media can be magnetic media (such as floppy disk, hard disk, magnetic tape), optical media, or semiconductor media, etc.

[0170] The above is only a specific embodiment of the present application. Those skilled in the art can think of changes or replacements based on the specific embodiments provided by the present application, which should be covered within the protection scope of the present application.

Claims

1. A cache management method, characterized in that, Applied to a computing cluster including at least one computing device, the computing cluster running a first process and a second process of a first user and a cache service process, the computing cluster including a shared memory pool, the method includes: The first process obtains the first I / O request corresponding to the first process; When the first process's current first memory space is insufficient to store the data corresponding to the first IO request, the first process sends a first cache request instruction to the cache service process. The first memory space is a segment of space in the shared memory pool and is shared by the first process and the second process. The first memory space belongs to the namespace of the first user. The cache service process allocates the second memory space in the shared memory pool to the first process according to the first cache request instruction; The second process obtains the second I / O request corresponding to the second process; When the first memory space corresponding to the second process is insufficient to store the data corresponding to the second IO request, the second process sends a second cache request instruction to the cache service process; The cache service process allocates the second memory space to the second process according to the second cache request instruction. The second memory space is shared by the first process and the second process, and the second memory space belongs to the namespace of the first user.

2. The method according to claim 1, characterized in that, The caching service process allocates a second memory space from the shared memory pool to the first process according to the first cache request instruction, including: When the cache service process determines that the frequency of cache request instructions received from the first user's process is higher than a frequency threshold, it allocates multiple second memory spaces from the shared memory pool to the first process according to the first cache request instructions.

3. The method according to claim 1 or 2, characterized in that, The caching service process allocates a second memory space from the shared memory pool to the first process according to the first cache request instruction, including: The cache service process allocates a second memory space from the shared memory pool to the first process according to the first capacity carried by the first cache request instruction, and the capacity of the second memory space is the first capacity.

4. The method according to claim 1 or 2, characterized in that, The capacity of the second memory space is fixed.

5. The method according to claim 1 or 2, characterized in that, The first memory space is shared by the first process, the second process, and the cache service process.

6. The method according to claim 1 or 2, characterized in that, The method further includes: After the first memory space is full, the caching service process stores the data in the first memory space to the disk of the computing cluster. The cache service process releases the first memory space shared by the first process, the second process, and the cache service process.

7. The method according to claim 6, characterized in that, The caching service process releases the first memory space shared by the first process, the second process, and the caching service process, including: When the caching service process determines that the usage of memory space in the namespace of the first user is lower than the usage threshold, it releases the first memory space shared by the first process, the second process, and the caching service process. The namespace of the first user includes the memory space allocated to the first process and the memory space allocated to the second process in the shared memory pool.

8. The method according to claim 6, characterized in that, The caching service process releases the first memory space shared by the first process, the second process, and the caching service process, including: The cache service process generates a marker information indicating that the first memory space is unavailable. The cache service process sends the marking information to the first process, and the marking information is used by the first process to release the first memory space corresponding to the first process. The cache service process sends the marking information to the second process, and the marking information is used by the second process to release the first memory space corresponding to the second process. The cache service process releases the first memory space corresponding to the cache service process.

9. The method according to claim 1 or 2, characterized in that, The first process, the second process, and the cache service process run on the same computing device or different computing devices in the computing cluster.

10. A cache management device, characterized in that, An apparatus applicable to a computing cluster including at least one computing device, the computing cluster running a first process and a second process of a first user and a cache service process, the computing cluster including a shared memory pool, the apparatus comprising: The acquisition module is used to acquire the first IO request corresponding to the first process through the first process; The sending module is used to send a first cache request instruction to the cache service process through the first process when the first memory space of the first process is insufficient to store the data corresponding to the first IO request. The first memory space is a segment of space in the shared memory pool and is shared by the first process and the second process. The first memory space belongs to the namespace of the first user. The memory allocation module is used to allocate the second memory space in the shared memory pool to the first process through the cache service process according to the first cache request instruction; The acquisition module is further configured to acquire the second IO request corresponding to the second process through the second process; The sending module is further configured to send a second cache request instruction to the cache service process through the second process when the first memory space corresponding to the second process is insufficient to store the data corresponding to the second IO request; The memory allocation module is further configured to allocate the second memory space to the second process through the cache service process according to the second cache request instruction. The second memory space is shared by the first process and the second process, and the second memory space belongs to the namespace of the first user.

11. The apparatus according to claim 10, characterized in that, The memory allocation module is specifically used for: When the cache service process determines that the frequency of cache request instructions received from the first user's process is higher than a frequency threshold, it allocates multiple second memory spaces from the shared memory pool to the first process according to the first cache request instructions.

12. The apparatus according to claim 10 or 11, characterized in that, The memory allocation module is specifically used for: The cache service process allocates a second memory space from the shared memory pool to the first process according to the first capacity carried by the first cache request instruction, and the capacity of the second memory space is the first capacity.

13. The apparatus according to claim 10 or 11, characterized in that, The capacity of the second memory space is fixed.

14. The apparatus according to claim 10 or 11, characterized in that, The first memory space is shared by the first process, the second process, and the cache service process.

15. The apparatus according to claim 10 or 11, characterized in that, The device further includes: a memory release module; The memory release module is used for: After the cache service process fills the first memory space with data, it stores the data in the first memory space into the disk of the computing cluster. The cache service process releases the first memory space shared by the first process, the second process, and the cache service process.

16. The apparatus according to claim 15, characterized in that, The memory release module is specifically used for: When the caching service process determines that the usage of memory space in the namespace of the first user is lower than the usage threshold, it releases the first memory space shared by the first process, the second process, and the caching service process. The namespace of the first user includes the memory space allocated to the first process and the memory space allocated to the second process in the shared memory pool.

17. The apparatus according to claim 15, characterized in that, The memory release module is specifically used for: The caching service process generates marking information indicating that the first memory space is unavailable. The caching service process sends the marking information to the first process, and the marking information is used by the first process to release the first memory space corresponding to the first process. The caching service process sends the marking information to the second process, and the marking information is used by the second process to release the first memory space corresponding to the second process. The cache service process releases the first memory space corresponding to the cache service process.

18. The apparatus according to claim 10 or 11, characterized in that, The first process, the second process, and the cache service process run on the same computing device or different computing devices in the computing cluster.

19. A computing cluster, characterized in that, The system includes at least one computing device, each of the at least one computing device including a processor and a memory; the processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device to cause the computing cluster to perform the method as described in any one of claims 1 to 9.

20. A computer storage medium, characterized in that, The computer storage medium stores a computer program for inter-process communication, which, when executed by a processor, implements the method as described in any one of claims 1 to 9.

Citation Information

Patent Citations

  • Multi-tenant space resource management method, system and device and storage medium

    CN113986528A

  • Communication method and device

    CN116361026A