A memory management method, memory device, computer equipment and storage medium

The virtual memory pool classification management of physical memory through the memory controller solves the data transmission bottleneck between the processor and memory, improves computing power and memory resource utilization, and meets the computing needs of big data and deep learning.

CN116954918BActive Publication Date: 2024-11-22CHONGQING BITMAP INFORMATION TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202310959793.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-28
Publication Date
2024-11-22
Estimated Expiration
2043-07-28

AI Technical Summary

Technical Problem

The memory management method in the prior art leads to a bottleneck in data transmission between the processor and memory, which cannot meet the requirements of computing efficiency and power consumption for applications such as big data and deep learning.

Method used

The virtual memory pool is classified and managed by the memory controller, and the free physical pages are quickly found from the global memory pool and in-memory computing memory pool according to the operation type, so as to realize the processor's read and write operations or in-memory computing of the idle physical pages , reduce data transmission bottlenecks and improve computing power.

Benefits of technology

At the same time, it meets the needs of traditional physical storage and in-memory computing, reduces the bottleneck of data transmission between the processor and memory, improves the computing power of the processor, and improves the utilization rate of the overall memory resources of the computer system, and avoids the idle and waste of resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116954918B_ABST
    Figure CN116954918B_ABST
Patent Text Reader

Abstract

The present invention provides a memory management method, a memory device, a computer equipment and a storage medium. The method comprises: according to the memory storage attribute of each physical page, all physical pages in the first physical memory component and the second physical memory component are divided into a virtual global memory pool and an in-memory computing memory pool; the memory controller obtains a target physical page from the global memory pool or / and the in-memory computing memory pool according to a physical memory allocation request sent by at least one processor, and sends a target storage address corresponding to the target physical page to a corresponding processor; the present invention simultaneously meets the requirements of traditional physical storage and in-memory computing, reduces the data transmission bottleneck between the processor and the memory, improves the computing power of the processor, and avoids the situation where resources are idle and wasted when the program does not need PIM participation or the benefit from PIM acceleration is low.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of memory management technology, and in particular to a memory management method, a memory device, a computer device and a storage medium. Background Art

[0002] In the traditional computer architecture (von Neumann architecture), the processor needs to read data from the memory, perform calculations, and then store the results back to the memory. This process involves frequent memory reads and writes, which will cause large delays and energy consumption, making the processor wait for the memory to read and write data much longer than the data calculation time, resulting in a data transmission bottleneck between the processor and the memory. On the one hand, with the popularization of applications such as big data and the Internet of Things and the continuous increase in data scale, the data transmission bottleneck between the processor and the memory leads to low data calculation efficiency of the processor; on the other hand, with the development of deep learning, the number of parameters of deep neural network models has increased rapidly, and the requirements for the computing power and power consumption of the processor are also getting higher and higher; therefore, the memory management method in the prior art causes the data transmission bottleneck between the processor and the memory, which cannot meet the data calculation requirements. Summary of the invention

[0003] In view of the deficiencies in the related art, the present invention provides a memory management method, a memory device, a computer equipment and a storage medium, which solve the data transmission bottleneck between the processor and the memory caused by the memory management method in the prior art.

[0004] In a first aspect, the present invention provides a memory management method, which is applied to a memory device supporting in-memory computing, wherein the memory device includes a memory controller connected to at least one processor, multiple first physical memory components supporting memory read and write operations, and multiple second physical memory components supporting memory read and write operations and in-memory computing, each physical memory component including a number of physical pages storing data, the method comprising: according to the memory storage attributes of each physical page, dividing all physical pages in the first physical memory component and the second physical memory component into a virtual global memory pool and an in-memory computing memory pool; the memory controller obtains a target physical page from the global memory pool or / and the in-memory computing memory pool according to a physical memory allocation request sent by the at least one processor, and sends a target storage address corresponding to the target physical page to the corresponding processor.

[0005] Optionally, the memory controller obtains the target physical page from the global memory pool or / and the in-memory computing memory pool according to the physical memory allocation request sent by the at least one processor, including: when the operation type in the physical memory allocation request is a read-write operation type, the memory controller obtains the target physical page from the global memory pool and sets the status attribute of the target physical page to normal occupation; when the operation type in the physical memory allocation request is an in-memory computing type, the memory controller obtains the target physical page from the in-memory computing memory pool and sets the status attribute of the target physical page to in-memory occupation.

[0006] Optionally, when the operation type in the physical memory allocation request is a read-write operation type, and no available physical page is obtained from the global memory pool, the method further includes: the memory controller obtains the target physical page from the in-memory computing memory pool, and sets the status attribute of the target physical page to normal occupation.

[0007] Optionally, when the operation type in the physical memory allocation request is in-memory computing type, and no available physical page is obtained from the in-memory computing memory pool, the method further includes: judging whether the in-memory computing memory pool is occupied by read-write operation type data according to the status attributes of the target physical page; when there is a first physical page occupied by read-write operation type data in the in-memory computing memory pool, obtaining a second physical page from the global memory pool; migrating the data stored in the first physical page to the second physical page, and using the first physical page as the target physical page.

[0008] Optionally, the memory controller obtains the target physical page from the global memory pool or the in-memory computing memory pool, including: establishing a virtual memory linked list that matches the global memory pool and the in-memory computing memory pool, the virtual memory linked list including a physical page number, a storage address, a memory storage attribute, and a status attribute; calculating the current allocation amount of the physical page according to the storage capacity requirement in the physical memory allocation request; judging, according to the operation type in the physical memory allocation request, whether there are at least two free physical pages in the virtual memory linked list that match the current allocation amount and have continuous storage addresses; if there are at least two free physical pages in the virtual memory linked list, using the at least two free physical pages as the target physical pages.

[0009] Optionally, if the at least two free physical pages do not exist in the virtual memory linked list, the method further includes: after performing memory recycling or memory compaction on the physical pages in the global memory pool or the in-memory computing memory pool, determining whether there are at least two free physical pages in the virtual memory linked list that match the current allocation and have continuous storage addresses.

[0010] Optionally, memory compaction is performed on the physical pages in the global memory pool, including: traversing the occupied physical pages from the starting position of the global memory pool to establish an allocated page list, and traversing the free physical pages from the tail position of the global memory pool to establish a free page list; when the traversal nodes of the two traversal algorithms are the same, migrating the storage data of the physical pages recorded in the allocated page list to the physical pages recorded in the free page list

[0011] In a second aspect, the present invention provides a memory device, comprising: a memory controller connected to at least one processor, a plurality of first physical memory components supporting memory read and write operations, and a plurality of second physical memory components supporting memory read and write operations and in-memory calculations, each physical memory component comprising a plurality of physical pages storing data; the memory controller is used to divide all physical pages in the first physical memory component and the second physical memory component into a virtual global memory pool and an in-memory calculation memory pool according to the memory storage attributes of each physical page; the memory controller is also used to obtain a target physical page from the global memory pool or / and the in-memory calculation memory pool according to a physical memory allocation request sent by the at least one processor, and send a target storage address corresponding to the target physical page to the corresponding processor.

[0012] In a third aspect, the present invention provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program: according to the memory storage properties of each physical page, all physical pages in the first physical memory component and the second physical memory component are divided into a virtual global memory pool and an in-memory computing memory pool; the memory controller obtains a target physical page from the global memory pool and / or the in-memory computing memory pool according to a physical memory allocation request sent by the at least one processor, and sends a target storage address corresponding to the target physical page to the corresponding processor.

[0013] In a fourth aspect, the present invention provides a readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the following steps: according to the memory storage properties of each physical page, all physical pages in the first physical memory component and the second physical memory component are divided into a virtual global memory pool and an in-memory computing memory pool; the memory controller obtains a target physical page from the global memory pool and / or the in-memory computing memory pool according to a physical memory allocation request sent by the at least one processor, and sends a target storage address corresponding to the target physical page to the corresponding processor.

[0014] Compared with the related art, the present invention has the following beneficial effects:

[0015] The present invention classifies and manages the physical memory supporting the in-memory computing technology and the traditional physical memory in a virtual memory pool through a memory controller, and quickly searches for free physical pages from the corresponding memory pool according to the operation type in the received physical memory allocation request, so that the processor performs read-write operations or in-memory calculations on the found free physical pages; therefore, the present invention simultaneously meets the requirements of traditional physical storage and in-memory calculations, reduces the data transmission bottleneck between the processor and the memory, and improves the computing power of the processor; further, in the present invention, the physical memory supporting the in-memory computing technology is used as a supplement to the traditional physical memory, that is, when the traditional physical storage space is insufficient, the physical memory supporting the in-memory computing technology can perform ordinary read-write storage, thereby improving the utilization rate of the overall memory resources of the computer system and avoiding the situation where resources are idle and wasted when the program does not need PIM participation or the benefit from PIM acceleration is low. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 FIG. 1 is a flow chart of a memory management method provided by this embodiment;

[0017] Figure 2 FIG. 1 is a schematic diagram of the structure of a memory device provided by this embodiment;

[0018] Figure 3 Shown is a schematic diagram comparing a prior art provided by this embodiment with this solution;

[0019] Figure 4 The figure shows a schematic diagram of a traditional memory allocation process provided by this embodiment;

[0020] Figure 5 FIG. 4 is a schematic diagram of a PIM memory allocation process provided by this embodiment. DETAILED DESCRIPTION

[0021] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.

[0022] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. In the absence of conflict, the features in the following embodiments and implementations can be combined with each other. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0023] In a first aspect, the present invention provides a memory management method, which specifically includes the following embodiments:

[0024] Figure 1 FIG. 1 is a flow chart of a memory management method provided by the present embodiment; the memory management method of the present embodiment is applied to a memory device supporting in-memory computing, such as Figure 2 As shown, the memory device includes a memory controller connected to at least one processor, a plurality of first physical memory components supporting memory read and write operations, and a plurality of second physical memory components supporting memory read and write operations and in-memory calculations, each physical memory component includes a number of physical pages storing data; wherein, one or more processors (CPU) are linked to the plurality of physical memory components through a memory controller (Memory controller), the physical memory components are implemented as common computer memory, and there is no specific restriction on the medium such as SRAM, DRAM, etc.; the physical memory components are divided into two types: ① the first physical memory component is traditional memory (Traditional Memory), which supports traditional memory read and write operations; ② the second physical memory component is in-memory calculation memory (PIM Memory), which supports both traditional memory read and write and local calculation logic such as multiplication and accumulation, and the hardware implementation of the specific PIM calculation logic unit includes digital PIM and analog PIM, etc. Each physical memory component includes several physical pages, and each physical page is not assigned a unique storage address. Through the memory controller, the CPU issues corresponding read and write operation instructions to the physical page of the target address. There is no special agreement between the physical page and the storage address, that is, any address may correspond to traditional memory or PIM memory. The memory properties of the specific address will be managed by the operating system after the motherboard is powered on. Figure 1 As shown, the memory management method provided in this embodiment specifically includes the following steps:

[0025] Step S101, according to the memory storage attribute of each physical page, all physical pages in the first physical memory component and the second physical memory component are divided into a virtual global memory pool and an in-memory computing memory pool.

[0026] In this embodiment, each individual physical page includes a data storage area and multiple indicator bits of different attributes, wherein the memory storage attribute indicates whether the physical page has in-memory computing capability. The memory storage attributes of all physical pages under the first physical memory component are set to the first value, indicating that there is no in-memory computing capability; conversely, the memory storage attributes of all physical pages under the second physical memory component are set to the second value, indicating that there is in-memory computing capability. All physical pages in the first physical memory component and the second physical memory component are uniformly managed to form a virtual memory pool; and the virtual memory pool is divided into a global memory pool and an in-memory computing memory pool according to the memory storage attributes of each physical page; wherein the global memory pool contains all physical memory pages in the first physical memory component, and the in-memory computing memory pool points to all physical memory pages in the second physical memory component.

[0027] Step S102: The memory controller obtains a target physical page from the global memory pool and / or the in-memory computing memory pool according to a physical memory allocation request sent by the at least one processor, and sends a target storage address corresponding to the target physical page to the corresponding processor.

[0028] In this embodiment, the memory controller obtains the target physical page from the global memory pool and / or the in-memory computing memory pool according to the physical memory allocation request sent by the at least one processor, including: when the operation type in the physical memory allocation request is a read-write operation type, the memory controller obtains the target physical page from the global memory pool and sets the status attribute of the target physical page to normal occupation; when the operation type in the physical memory allocation request is an in-memory computing type, the memory controller obtains the target physical page from the in-memory computing memory pool and sets the status attribute of the target physical page to in-memory occupation.

[0029] It should be noted that when the memory controller receives a physical memory allocation request sent by one or more processors, it determines whether to search for free physical pages from the global memory pool or the in-memory computing memory pool according to the operation type included in the physical memory allocation request; when the operation type in the physical memory allocation request is a read-write operation type, the memory controller obtains the target physical page from the global memory pool by searching for a free page table or a memory page rotation method, and sets the status attribute of the target physical page to normal occupation; when the operation type in the physical memory allocation request is an in-memory computing type, the memory controller obtains the target physical page from the in-memory computing memory pool by searching for a free page table or a memory page rotation method, and sets the status attribute of the target physical page to in-memory occupation to achieve effective allocation and utilization of general physical memory resources.

[0030] Furthermore, in-memory computing is a hot research direction and development trend in the current computer field. By implementing computing operations in memory, the boundary between memory and processing units is eliminated, and there is no need to reload data from the memory, providing faster computing speed and lower energy consumption. However, currently in-memory computing is mainly mounted on the system in the form of accelerators, such as CPU-GPU heterogeneous systems, such as Figure 3 As shown, 3a represents a heterogeneous system in the prior art, where both the memory and the PIM accelerator are mounted on the system bus. When performing ordinary read and write operations, the processor directly reads and writes data from the memory, and when performing PIM calculations, the processor reads and writes data from the PIM accelerator through the memory; since its computing unit and the read and write target are located on different hardware devices, data needs to be transmitted through the memory (memory) as an intermediary, so the data transmission process in the prior art will inevitably introduce data handling overhead between the computing logic unit and the storage unit, including data replication, data transmission, data format conversion and other operations, thereby resulting in additional computing time and energy consumption. 3b represents the system architecture of this embodiment, where the processor is directly linked to the ordinary memory and the PIM memory through the memory controller, avoiding data handling between the computing logic unit and the storage unit and improving data processing efficiency.

[0031] Compared with the related art, the present invention has the following beneficial effects:

[0032] The present invention classifies and manages the physical memory supporting the in-memory computing technology and the traditional physical memory in a virtual memory pool through a memory controller, and quickly searches for free physical pages from the corresponding memory pool according to the operation type in the received physical memory allocation request, so that the processor performs read-write operations or in-memory calculations on the found free physical pages; therefore, the present invention simultaneously meets the requirements of traditional physical storage and in-memory calculations, reduces the data transmission bottleneck between the processor and the memory, and improves the computing power of the processor; further, in the present invention, the physical memory supporting the in-memory computing technology is used as a supplement to the traditional physical memory, that is, when the traditional physical storage space is insufficient, the physical memory supporting the in-memory computing technology can perform ordinary read-write storage, thereby improving the utilization rate of the overall memory resources of the computer system and avoiding the situation where resources are idle and wasted when the program does not need PIM participation or the benefit from PIM acceleration is low.

[0033] In one embodiment of the present invention, when the operation type in the physical memory allocation request is a read-write operation type, and no available physical page is obtained from the global memory pool, the method further includes: the memory controller obtains the target physical page from the in-memory computing memory pool, and sets the status attribute of the target physical page to normal occupation.

[0034] In another embodiment of the present invention, when the operation type in the physical memory allocation request is in-memory computing type, and no available physical page is obtained from the in-memory computing memory pool, the method further includes: judging whether the in-memory computing memory pool is occupied by read-write operation type data according to the status attributes of the target physical page; when there is a first physical page occupied by read-write operation type data in the in-memory computing memory pool, obtaining a second physical page from the global memory pool; migrating the data stored in the first physical page to the second physical page, and using the first physical page as the target physical page.

[0035] It should be noted that when the system is required to allocate general physical memory resources, such as Figure 4 As shown, the memory is obtained in the global memory pool through an algorithm, such as searching for a free page table or a memory page rotation algorithm, and executed according to the current general memory allocation method to achieve effective allocation and utilization of memory resources. Optionally, the allocation priority of PIM memory is set to be lower than that of traditional memory, that is, when both traditional memory and PIM memory can be used as allocated objects, traditional memory is always allocated. For example, when sufficient memory resources cannot be allocated after traditional memory recycling, PIM memory is applied for. For example, the specific allocation steps are as follows: (1) Process A applies for traditional memory resources with a capacity of L1KB through a system call; (2) The system attempts to scan and search for L1KB free memory in the global memory pool; (3) If there is not enough free memory, the system attempts to allocate again through the memory recycling mechanism; (4) After the resource is allocated, it is checked whether the application source belongs to PIM memory recycling. If the allocation purpose is PIM memory recycling, the allocation fails; (5) If the allocation purpose is not PIM memory recycling, an application is made to the PIM memory pool to allocate L1KB space. (6) Based on the result of the PIM memory application, if the application fails, the system abnormal memory shortage is reported. If the PIM memory address pointer Addr1 is returned, the indicator bit of the address is modified to be used as traditional memory and returned to the process as the traditional memory address.

[0036] When the system is asked to allocate PIM memory resources, such as Figure 5As shown, the memory allocation algorithm is executed in the in-memory computing memory pool. The mapping ranges of the two resources are different, but the algorithms executed are the same. When the free PIM memory resources searched through the traversal do not meet the allocation requirements, the PIM memory internal compaction and rearrangement are used to try to allocate again; after the internal allocation of the PIM memory pool fails, the indicator bit is checked to see whether the current resource occupancy is for PIM calculation. If the resource is preempted during traditional memory allocation, the traditional memory is applied with the same priority as the process memory allocation and the data of the migrated PIM memory page is copied; after the migration is completed, the memory compaction and allocation are tried again, and the corresponding physical memory address is returned if the allocation is successful. For example, the specific allocation steps are as follows: (1) Process B applies for a PIM memory resource with a capacity of L2KB through a system call; (2) The system attempts to scan and search for L2KB free resources in the PIM memory pool; (3) If there is not enough free PIM memory, the system attempts to allocate again through the memory compaction and rearrangement mechanism; (4) If the allocation fails again, the indicator bit of the current PIM memory is checked to see whether the resource is in use for PIM calculation; (5) If the current resource has been allocated to PIM calculation, an exception of insufficient PIM memory is returned. (6) If the current resource is preempted in the traditional memory allocation, apply for L2KB of traditional memory; (7) If the application fails, return a PIM insufficient memory exception; if the memory address Addr2 is successfully returned, the non-PIM calculation memory data of L2KB at address Addr3 is moved to Addr2 through a system call; (8) Modify the free memory indicator bit of Addr3 to PIM calculation, and return Addr3 to process control.

[0037] In another embodiment of the present invention, the memory controller obtains the target physical page from the global memory pool or the in-memory computing memory pool, including: establishing a virtual memory linked list matching the global memory pool and the in-memory computing memory pool, the virtual memory linked list including a physical page number, a storage address, a memory storage attribute and a status attribute; calculating the current allocation amount of the physical page according to the storage capacity requirement in the physical memory allocation request; judging whether there are at least two free physical pages in the virtual memory linked list that match the current allocation amount and have continuous storage addresses according to the operation type in the physical memory allocation request; if there are at least two free physical pages in the virtual memory linked list, using the at least two free physical pages as the target physical pages.

[0038] Among them, if the at least two free physical pages do not exist in the virtual memory linked list, the method also includes: after reclaiming and compacting the physical pages in the global memory pool or the in-memory computing memory pool, it is determined whether there are at least two free physical pages in the virtual memory linked list that match the current allocation amount and have continuous storage addresses.

[0039] Optionally, memory compaction is performed on the physical pages in the global memory pool, including: traversing the occupied physical pages starting from the starting position of the global memory pool to establish an allocated page list, and traversing the free physical pages starting from the tail position of the global memory pool to establish a free page list; when the traversal nodes of the two traversal algorithms are the same, migrating the storage data of the physical pages recorded in the allocated page list to the physical pages recorded in the free page list.

[0040] It should be noted that the operating system provides multiple interfaces that support PIM memory-specific operations. The functional classification of the interfaces can be expressed as: applying for PIM memory resources to perform PIM calculations on target address data and writing back the PIM calculation results to the target address. Furthermore, the specific implementation of the interface can include multiple categories, such as "completing PIM calculations and writing results to a specific address."

[0041] The above description refers to the allocation and operation of memory resources by the system, which is only for illustrating the principle and implementation of the present invention, and does not limit the specific implementation of the present invention, and covers all variants and modifications equivalent to the above implementation. The current in-memory computing technology is mainly utilized by integrating a PIM accelerator in the system, but such an architecture cannot avoid a large amount of data transfer overhead between the memory storage and the accelerator's dedicated storage. On the other hand, due to the single computing logic of pure PIM technology, the scenarios in which huge acceleration benefits can be obtained by using PIM are relatively limited.

[0042] By incorporating traditional memory and in-memory computing memory into the same virtual memory architecture, the overall memory resource utilization of the computer system is improved, and the situation where the program does not need PIM participation or the resources are idle and wasted when the benefit from PIM acceleration is low is avoided. The memory management architecture proposed by the present invention is basically consistent with the commonly used computer system software and hardware, has the characteristics of strong scalability and compatibility, can give full play to the advantages of in-memory computing technology, and has great application potential for improving the versatility of PIM technology and promoting the practical application of PIM technology; the physical memory supporting in-memory computing technology can be used as a supplement to the traditional physical main memory, and the PIM memory can coexist in the computer architecture as a component of the physical memory, and is equivalently mapped by the virtual memory. When applying for memory from the system, different memory addresses are allocated according to the memory resource situation and the purpose of the application. When the PIM memory is preempted by the traditional memory allocation, the data in the PIM memory can be released and reallocated through the corresponding algorithm. It can be used as a participant in PIM calculation and can also be read and written by ordinary memory operations; PIM memory and traditional memory can be managed as resources of the same memory pool, or they can belong to two memory pools respectively. The core is that PIM memory can participate in memory allocation as a supplement to traditional memory. This process can be system transparent or it can explicitly preempt PIM memory.

[0043] In a second aspect, the present invention provides a memory device, comprising: a memory controller connected to at least one processor, a plurality of first physical memory components supporting memory read and write operations, and a plurality of second physical memory components supporting memory read and write operations and in-memory calculations, each physical memory component comprising a plurality of physical pages storing data; the memory controller is used to divide all physical pages in the first physical memory component and the second physical memory component into a virtual global memory pool and an in-memory calculation memory pool according to the memory storage attributes of each physical page; the memory controller is also used to obtain a target physical page from the global memory pool or / and the in-memory calculation memory pool according to a physical memory allocation request sent by the at least one processor, and send a target storage address corresponding to the target physical page to the corresponding processor.

[0044] In a third aspect, the present invention provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program: according to the memory storage properties of each physical page, all physical pages in the first physical memory component and the second physical memory component are divided into a virtual global memory pool and an in-memory computing memory pool; the memory controller obtains a target physical page from the global memory pool and / or the in-memory computing memory pool according to a physical memory allocation request sent by the at least one processor, and sends a target storage address corresponding to the target physical page to the corresponding processor.

[0045] In a fourth aspect, the present invention provides a readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the following steps: according to the memory storage properties of each physical page, all physical pages in the first physical memory component and the second physical memory component are divided into a virtual global memory pool and an in-memory computing memory pool; the memory controller obtains a target physical page from the global memory pool and / or the in-memory computing memory pool according to a physical memory allocation request sent by the at least one processor, and sends a target storage address corresponding to the target physical page to the corresponding processor.

[0046] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

Claims

1. A memory management method, It is characterized in that A memory device for supporting in-memory computing, the memory device comprising a memory controller connected to at least one processor, a plurality of first physical memory components supporting memory read and write operations, and a plurality of second physical memory components supporting memory read and write operations and in-memory computing, each physical memory component comprising a plurality of physical pages storing data, the method comprising: According to the memory storage attribute of each physical page, all physical pages in the first physical memory component and the second physical memory component are divided into a virtual global memory pool and an in-memory computing memory pool; the global memory pool includes all physical memory pages in the first physical memory component, and the in-memory computing memory pool includes all physical memory pages in the second physical memory component; The memory controller obtains a target physical page from the global memory pool and the in-memory computing memory pool according to a physical memory allocation request sent by the at least one processor, and sends a target storage address corresponding to the target physical page to a corresponding processor; The memory controller obtains a target physical page from the global memory pool and the in-memory computing memory pool according to a physical memory allocation request sent by the at least one processor, including: When the operation type in the physical memory allocation request is a read-write operation type, the memory controller obtains the target physical page from the global memory pool and sets the state attribute of the target physical page to normal occupation; When the operation type in the physical memory allocation request is in-memory computing type, the memory controller obtains the target physical page from the in-memory computing memory pool, and sets the state attribute of the target physical page to in-memory occupation; When the operation type in the physical memory allocation request is a read-write operation type, and no available physical page is obtained from the global memory pool, the method further includes: the memory controller obtains the target physical page from the in-memory computing memory pool, and sets the state attribute of the target physical page to normal occupation.

2. The memory management method according to claim 1, It is characterized in that When the operation type in the physical memory allocation request is an in-memory computing type, and no available physical page is obtained from the in-memory computing memory pool, the method further includes: Determining whether the in-memory computing memory pool is occupied by read-write operation type data according to the state attribute of the target physical page; When there is a first physical page occupied by read-write operation type data in the in-memory computing memory pool, obtaining a second physical page from the global memory pool; The data stored in the first physical page is migrated to the second physical page, and the first physical page is used as the target physical page.

3. The memory management method according to claim 1, It is characterized in that The memory controller obtains a target physical page from the global memory pool or the in-memory computing memory pool, including: Establishing a virtual memory linked list matching the global memory pool and the in-memory computing memory pool, wherein the virtual memory linked list includes a physical page number, a storage address, a memory storage attribute, and a state attribute; Calculating the current allocation amount of the physical page according to the storage capacity requirement in the physical memory allocation request; According to the operation type in the physical memory allocation request, determining whether there are at least two free physical pages in the virtual memory linked list that match the current allocation amount and have continuous storage addresses; If the at least two idle physical pages exist in the virtual memory linked list, the at least two idle physical pages are used as the target physical pages.

4. The memory management method according to claim 3, It is characterized in that If the at least two free physical pages do not exist in the virtual memory linked list, the method further includes: after performing memory recycling or memory compaction on the physical pages in the global memory pool or the in-memory computing memory pool, determining whether there are at least two free physical pages in the virtual memory linked list that match the current allocation and have continuous storage addresses.

5. The memory management method according to claim 4, It is characterized in that Performing memory compaction on physical pages in the global memory pool includes: Traversing the occupied physical pages from the start position of the global memory pool to establish an allocated page list, and traversing the free physical pages from the end position of the global memory pool to establish a free page list; When the traversal nodes of the two traversal algorithms are the same, the storage data of the physical page recorded in the allocated page linked list is migrated to the physical page recorded in the free page linked list.

6. A memory device, It is characterized in that The memory device comprises: A memory controller connected to at least one processor, a plurality of first physical memory components supporting memory read and write operations, and a plurality of second physical memory components supporting memory read and write operations and in-memory computing, each physical memory component including a plurality of physical pages storing data; The memory controller is used to divide all physical pages in the first physical memory component and the second physical memory component into a virtual global memory pool and an in-memory computing memory pool according to the memory storage attribute of each physical page; the global memory pool includes all physical memory pages in the first physical memory component, and the in-memory computing memory pool includes all physical memory pages in the second physical memory component; The memory controller is further configured to obtain a target physical page from the global memory pool and the in-memory computing memory pool according to a physical memory allocation request sent by the at least one processor, and send a target storage address corresponding to the target physical page to a corresponding processor; The memory controller obtains a target physical page from the global memory pool and the in-memory computing memory pool according to a physical memory allocation request sent by the at least one processor, including: When the operation type in the physical memory allocation request is a read-write operation type, the memory controller obtains the target physical page from the global memory pool and sets the state attribute of the target physical page to normal occupation; When the operation type in the physical memory allocation request is in-memory computing type, the memory controller obtains the target physical page from the in-memory computing memory pool, and sets the state attribute of the target physical page to in-memory occupation; When the operation type in the physical memory allocation request is a read-write operation type, and no available physical page is obtained from the global memory pool, the device also includes: the memory controller obtains the target physical page from the in-memory computing memory pool, and sets the status attribute of the target physical page to normal occupation.

7. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

8. A readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Memory management method and related device

    CN109062693A

  • Memory management method and device and computing equipment

    CN111414248A

  • In-memory calculation method based on coarse-grained reconfigurable array

    CN112463719A

  • Memory management method and device

    CN115129459A

  • Memory allocation method and device and electronic equipment

    CN115421908A