CXL module, controller, task processing method, medium and system

By establishing an address mapping relationship between virtual address to shared storage space and first storage space in the controller of the CXL module, the problem of low efficiency of multi-task data storage management in the CXL module is solved, the load of the host virtual memory manager is reduced, and the efficiency and reliability of the system are improved.

CN118760635BActive Publication Date: 2025-06-06BEIJING SUPERSTRING ACAD OF MEMORY TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410904395.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-05
Publication Date
2025-06-06
Estimated Expiration
2044-07-05

AI Technical Summary

Technical Problem

The prior art is difficult to efficiently manage the data storage of multiple computing tasks in a CXL module, and the virtual memory manager of the host is overloaded, affecting system efficiency and reliability.

Method used

By establishing an address mapping relationship between the virtual address to the shared storage space and the first storage space in the controller of the CXL module, the virtual address to the external physical address and memory address of the data access instruction is converted, thereby reducing the load of the virtual memory manager of the host.

Benefits of technology

It improves the storage space utilization of CXL modules, shortens the response time of the CXL module and the host co-processing tasks, and enhances the efficiency and reliability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118760635B_ABST
    Figure CN118760635B_ABST
Patent Text Reader

Abstract

A CXL module, a controller, a task processing method, a medium and a system, relating to the technical field of data access, wherein the CXL module comprises a controller and a memory chip connected to the controller, the memory is provided with a shared storage space that allows the controller and a host to access, a first storage space that only allows the controller to access, and a second storage space that only allows the host to access; the controller is configured to: establish a first address mapping relationship from a virtual address to an external physical address corresponding to the shared storage space and a second address mapping relationship from the virtual address to a memory address of the first storage space; when executing a computing task, convert the virtual address carried in a data access instruction into an external physical address according to the first address mapping relationship, and access the corresponding data according to the external physical address; convert the virtual address carried in the data access instruction into a memory address according to the second address mapping relationship, and access the corresponding data according to the memory address.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of data access technology, and more particularly to a CXL module, a controller, a task processing method, a medium, and a system. Background Art

[0002] CXL (Compute Express Link) is a new memory interface protocol based on the PCIe (Peripheral Component Interconnect Express) physical layer. It can realize the sharing of multiple computing nodes, so that application layer software can read and write the memory in the CXL module just like reading and writing the host memory. Summary of the invention

[0003] Embodiments of the present disclosure provide a CXL module, a controller, a task processing method, a medium, and a system.

[0004] In a first aspect, an embodiment of the present disclosure provides a CXL module, comprising a controller and a memory chip connected to the controller, wherein the memory is provided with a shared storage space that allows access by the controller and a host, a first storage space that only allows access by the controller, and a second storage space that only allows access by the host; the controller is configured to: establish a first address mapping relationship from a virtual address to an external physical address corresponding to the shared storage space; when executing a computing task, convert the virtual address carried in a data access instruction into an external physical address according to the first address mapping relationship, and access the corresponding data according to the converted external physical address; establish a second address mapping relationship from the virtual address to a memory address of the first storage space; when executing a computing task, convert the virtual address carried in the data access instruction into a memory address according to the second address mapping relationship, and access the corresponding data according to the converted memory address; receive an external access instruction sent by the host, the external access instruction carrying an external physical address to be accessed; and access the second storage space and / or the shared storage space according to the external physical address to be accessed.

[0005] In a second aspect, an embodiment of the present disclosure provides a controller, which is applied to the CXL module in the above embodiment, wherein the CXL module includes a memory connected to the controller, the memory is provided with a shared storage space that allows the controller and the host to access, a first storage space that only allows the controller to access, and a second storage space that only allows the host to access, and the controller includes a processor and a virtual memory manager; wherein the virtual memory manager is configured to: convert the virtual address carried in the data access instruction into the external physical address according to a first address mapping relationship from the virtual address to the external physical address corresponding to the shared storage space; convert the virtual address in the data access instruction into the memory address according to a second address mapping relationship from the virtual address to the memory address of the first storage space; the processor is configured to: establish the first address mapping relationship; when executing a computing task, access the corresponding data according to the external physical address converted by the virtual memory manager; establish the second address mapping relationship; when executing a computing task, access the corresponding data according to the memory address converted by the virtual memory manager; receive an external access instruction sent by the host, the external access instruction carrying the external physical address to be accessed; access the second storage space and / or the shared storage space according to the external physical address to be accessed.

[0006] In a third aspect, an embodiment of the present disclosure provides a task processing method, which is applied to the CXL module in the above embodiment, wherein the CXL module includes a controller and a memory connected to the controller, wherein the memory is provided with a shared storage space that allows the controller and the host to access, a first storage space that only allows the controller to access, and a second storage space that only allows the host to access, and the method includes: establishing a first address mapping relationship from a virtual address to an external physical address corresponding to the shared storage space and a second address mapping relationship from a virtual address to a memory address of the first storage space; when executing a computing task, converting the virtual address carried in a data access instruction into an external physical address according to the first address mapping relationship, and accessing corresponding data according to the converted external physical address; converting the virtual address carried in the data access instruction into a memory address according to the second address mapping relationship, and accessing corresponding data according to the converted memory address; and receiving an external access instruction sent by the host, the external access instruction carrying an external physical address to be accessed; and accessing the second storage space and / or the shared storage space according to the external physical address to be accessed.

[0007] In a fourth aspect, an embodiment of the present disclosure provides a non-volatile computer storage medium, wherein the computer storage medium stores a computer program, and when the computer program is executed by a processor, the task processing method in the above embodiment is implemented.

[0008] In a fifth aspect, an embodiment of the present disclosure provides a computer system, including a host and the CXL module in the above embodiment, wherein the host communicates with the CXL module via a CXL interface to achieve discovery, configuration and data transmission of the CXL module.

[0009] In the CXL module of the disclosed embodiment, the controller can establish a first address mapping relationship from a virtual address to an external physical address corresponding to a shared storage space and a second address mapping relationship from a virtual address to a memory address of the first storage space, so that when executing a computing task, the virtual address carried in the data access instruction can be converted into an external physical address according to the first address mapping relationship, and the virtual address carried in the data access instruction can be converted into a memory address according to the second address mapping relationship, and the corresponding data can be accessed according to the converted external physical address and memory address; the second storage space and / or the shared storage space can also be accessed according to the external physical address to be accessed carried in the external access instruction. This not only improves the utilization rate of the storage space of the CXL module, but also implements memory access processing according to the virtual address without going through the operating system of the host. On the one hand, it shortens the response time of the CXL module and the host co-processing tasks, which helps to improve the efficiency and reliability of the CXL module and the host co-processing tasks; on the other hand, the CXL module replaces the host to implement the conversion of the virtual address to the external physical address, which can reduce the load of the virtual memory manager of the host.

[0010] Other features and advantages of the present disclosure will be described in the following description, and partly become clearer from the description, or understood by implementing the present disclosure. Other advantages of the present disclosure can be realized and obtained by the schemes described in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The accompanying drawings are used to provide an understanding of the technical solution of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the technical solution of the present disclosure and do not constitute a limitation on the technical solution of the present disclosure.

[0012] Figure 1 It is a structural schematic diagram of an embodiment of the CXL module disclosed in the present invention;

[0013] Figure 2 It is a schematic diagram of the principle of an embodiment of the CXL module disclosed in the present invention;

[0014] Figure 3 It is a structural schematic diagram of an embodiment of the CXL module disclosed in the present invention;

[0015] Figure 4 It is a structural schematic diagram of an embodiment of the CXL module disclosed in the present invention;

[0016] Figure 5is a schematic structural diagram of an embodiment of a controller disclosed herein;

[0017] Figure 6 is a schematic structural diagram of an embodiment of a controller disclosed herein;

[0018] Figure 7 A flowchart of an embodiment of the task processing method disclosed in the present invention;

[0019] Figure 8 A schematic diagram of a process of establishing a first address mapping relationship in an embodiment of the task processing method disclosed herein;

[0020] Fig. 9 A schematic diagram of a flow chart of establishing a second address mapping relationship in one embodiment of the task processing method disclosed herein;

[0021] Fig.10 A flowchart of another embodiment of the task processing method disclosed in the present invention;

[0022] Fig.11 A schematic diagram of a process of terminating a task in one embodiment of the task processing method disclosed herein;

[0023] Fig.12 A schematic diagram of the structure of a computer system according to an embodiment of the present invention. DETAILED DESCRIPTION

[0024] In order to make the purpose, technical solution and advantages of the present disclosure more clear, the embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings. It should be noted that the embodiments and features in the embodiments of the present disclosure can be combined with each other arbitrarily without conflict.

[0025] The embodiments of the present disclosure are not necessarily limited to the dimensions shown in the drawings, and the shapes and sizes of the components in the drawings do not reflect the true proportions. In addition, the drawings schematically show ideal examples, and the embodiments of the present disclosure are not limited to the shapes or values ​​shown in the drawings.

[0026] In the present disclosure, ordinal numbers such as “first” and “second” are provided to avoid confusion among constituent elements and do not indicate any order, quantity or importance.

[0027] In the present disclosure, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection, or an electrical connection; it can be a direct connection, or an indirect connection through an intermediate, or the internal communication of two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present disclosure can be understood according to specific circumstances.

[0028] like Figure 1 As shown, an embodiment of the present disclosure provides a CXL module, which includes a controller 110 and a memory 120 connected to the controller 110. The memory 120 may include, for example, a plurality of DRAM (Dynamic Random Access Memory) chips. The memory 120 is provided with a shared storage space that allows the controller 110 and the host to access, a first storage space that only allows the controller to access, and a second storage space that only allows the host to access; the controller 110 is configured to: establish a first address mapping relationship from a virtual address (Virtual Address) to an external physical address corresponding to the shared storage space; when executing a computing task, convert the virtual address carried in the data access instruction into an external physical address according to the first address mapping relationship, and access the corresponding data according to the converted external physical address; establish a second address mapping relationship from the virtual address to the memory address of the first storage space; when executing a computing task, convert the virtual address carried in the data access instruction into a memory address according to the second address mapping relationship, and access the corresponding data according to the converted memory address; receive an external access instruction sent by the host, the external access instruction carrying an external physical address to be accessed; access the second storage space and / or the shared storage space according to the external physical address to be accessed.

[0029] Generally, the controller 110 can be in the form of a control chip or integrated into a memory chip, on which a CXL interface based on the CXL protocol can be provided so that the host (Host) can interact with the controller 110 through the CXL interface. For example, based on the CXL.mem protocol or the CXL.cache protocol, the host CPU can send a memory access instruction to the controller 110 to access the data in the memory 120. At this time, the address information involved in the memory access instruction is an external physical address, that is, the address carried in the message sent by the host CPU to the CXL module through the address bus; when the CXL module receives the message from the address bus, the external physical address can be extracted from it, and then the external physical address can be converted into the address of the storage unit in the memory chip (such as a DRAM chip) through proprietary hardware (such as an address translator). The controller 110 can also be provided with a DDR controller for managing the memory 120, for example, the data in the memory 120 can be accessed according to the memory address. For another example, based on the CXL.io protocol, the host CPU can also send task instructions or other control instructions to the controller 110.

[0030] Virtual memory technology allows applications to read and write data using virtual addresses, and the host CPU can translate virtual addresses into physical addresses in real time, so that the memory usage of each task can be managed to ensure that the storage space corresponding to each task will not trample on each other. In addition, with the help of virtual memory technology, a unified programming environment can be provided for developers, and multiple applications can be dynamically loaded and run. At present, the virtual addresses involved in host instructions (such as instructing the CXL module to fetch data from a certain address) can only be translated into physical addresses by the virtual memory manager (Memory Manage Unit, MMU) in the host CPU. This processing process requires the host's computing resources, which increases the host load, takes a long time, and has certain security risks.

[0031] In this embodiment, the data access instruction is an instruction generated by the controller 110 for accessing data in the memory 120. The controller 110 first determines the virtual address corresponding to the data to be accessed, then converts the virtual address into an external physical address or a memory address, and then accesses the corresponding data in the memory 120 according to the external physical address or the memory address, thereby completing the conversion between the virtual address and the external physical address or the memory address within the CXL module. In this way, the controller 110 can manage the data storage of multiple tasks through the virtual address, avoid mutual trampling, and shorten the response time of the CXL module and the host co-processing tasks.

[0032] In addition, the shared storage space can allow access by the controller 110 and the host. When the host needs to access data in the shared storage space, it can send a memory access instruction to the controller 110 based on the CXL.mem protocol or the CXL.cache protocol. The address information carried in the memory access instruction is an external physical address. Therefore, when the controller accesses data, it converts the virtual address into an external physical address, and then accesses the corresponding data based on the external physical address, which can more conveniently manage the consistency of data in the shared storage space.

[0033] When the CXL module and the host perform collaborative processing of computing tasks, the data required by the CXL module during the execution of the computing task is of low importance to the host. This part of the data can be stored in a first storage space that only the controller is allowed to access, and a second address mapping relationship from the virtual address to the memory address of the first storage space is established. Subsequently, when the controller executes the computing task, it can generate a data access instruction carrying a virtual address according to demand, and then translate the virtual address into a memory address and use it to access the data in the first storage space. For example, the original data of the computing task can be read from the first storage space or the intermediate data generated during the task execution can be stored in the first storage space. In this way, the controller can manage the storage of the original data and intermediate data involved in the computing task in the first storage space based on the virtual address. Optionally, when the controller completes the computing task, the obtained processing result can be stored in the shared storage space so that the host can read the processing result from the shared storage space.

[0034] In some optional implementations of this embodiment, in order to facilitate hardware implementation, the controller may also establish a third address mapping relationship from the virtual address to the external physical address corresponding to the first storage space. When the controller needs to access data in the first storage space, it may first translate the virtual address into the external physical address according to the third address mapping relationship, and then translate the external physical address into the memory address of the first storage space.

[0035] In this embodiment, the data required to execute the computing task is stored in the first storage space. On the one hand, this can reduce the storage resources occupied by the computing task in the shared storage space and the number of addresses recorded in the first address mapping relationship, thereby reducing the storage resources occupied by the first address mapping relationship inside the CXL module and in the host. On the other hand, since the first storage space is only accessible to the controller, the second address mapping relationship only needs to be stored in the CXL module and does not need to be stored in the host, thereby further reducing the storage pressure of the host.

[0036] In one example, the host CPU can instruct the processor of the controller 110 to establish a computing task through a task instruction. At this time, the task instruction can include the virtual address corresponding to the computing task and the size of the storage space required to be occupied. The controller 110 can allocate a storage area for the computing task in the shared storage space according to the task instruction, and establish a first address mapping relationship between the external physical address of the storage area and the virtual address. When the controller 110 subsequently executes the computing task, it can generate a data access instruction according to the virtual address corresponding to the computing task to access the data required during the execution process. For example, the data generated during the execution of the task and the processing results obtained after the execution are stored in the shared storage space, and the host can access this part of the data through an external memory access instruction. In this way, the controller 110 can manage the data storage of the computing task based on the virtual address, and in a multi-task scenario, it can avoid the mutual trampling of the data of multiple tasks.

[0037] In the CXL module of this embodiment, the controller can establish a first address mapping relationship from the virtual address to the external physical address corresponding to the shared storage space and a second address mapping relationship from the virtual address to the memory address of the first storage space, so that when executing a computing task, the virtual address carried in the data access instruction can be converted into an external physical address according to the first address mapping relationship, and the virtual address carried in the data access instruction can be converted into a memory address according to the second address mapping relationship, and the corresponding data can be accessed according to the converted external physical address and memory address; the second storage space and / or the shared storage space can also be accessed according to the external physical address to be accessed carried in the external access instruction. Not only is the utilization rate of the storage space of the CXL module improved, but also the memory access processing according to the virtual address can be realized without the operating system of the host. On the one hand, the response time of the CXL module and the host co-processing tasks is shortened, which helps to improve the efficiency and reliability of the CXL module and the host co-processing tasks; on the other hand, the CXL module replaces the host to realize the conversion of the virtual address to the external physical address, which can reduce the load of the virtual memory manager of the host.

[0038] In some embodiments, the first address mapping relationship includes a first address mapping table corresponding to each computing task; and the controller is configured to establish a first address mapping relationship from a virtual address to an external physical address corresponding to a shared storage space, including: receiving a first task assignment instruction sent by the host, the first task assignment instruction including an identifier of the task to be assigned, a first virtual address corresponding to the task to be assigned, and the size of the storage space required for the task to be assigned; according to the first task assignment instruction, determining a storage area corresponding to the task to be assigned in the shared storage space, and determining a first address mapping table between the external physical address of the storage area and the first virtual address; determining a correspondence between the first address mapping table and the identifier of the task to be assigned; and sending the first address mapping table to the host.

[0039] In this embodiment, the controller can process multiple computing tasks and generate a first address mapping table for each computing task according to the first task allocation instruction of the host. Here, the first task allocation instruction is used to instruct the controller to divide the storage area for the task to be assigned in the shared storage space and determine the first address mapping table. The CXL module and the host both store the first address mapping table corresponding to each computing task, so as to access the shared storage space later according to the virtual address and external physical address recorded in the first address mapping table.

[0040] In some embodiments, the second address mapping relationship includes a second address mapping table corresponding to each computing task; and the controller is configured to establish a second address mapping relationship from a virtual address to a memory address of a first storage space, including: receiving a second task assignment instruction sent by the host, the second task assignment instruction including an identifier of the task to be assigned, a second virtual address corresponding to the task to be assigned, and the size of the storage space required for the task to be assigned; according to the second task assignment instruction, determining a storage area corresponding to the task to be assigned in the first storage space, and determining a second address mapping table between the memory address of the storage area and the second virtual address; determining a correspondence between the second address mapping table and the identifier of the task to be assigned.

[0041] In this embodiment, the controller can generate a second address mapping table for each computing task according to the second task assignment instruction of the host. Here, the second task assignment instruction is used to instruct the controller to divide the storage area for the task to be assigned in the first storage space and determine the second address mapping table. Subsequently, the controller can access the first storage space according to the virtual address and memory address recorded in the second address mapping table corresponding to each computing task. In this way, each computing task can correspond to a first address mapping table and a second address mapping table at the same time, which is convenient for the controller to manage the execution process of the computing task and the data storage of the processing results according to the virtual address.

[0042] Next reference Figure 2 , Figure 2 FIG. 1 is a schematic diagram showing a principle of an embodiment of a CXL module of the present disclosure. Figure 2 As shown, the memory 210 of the CXL module includes a shared storage space 211, a first storage space 212, and a second storage space 213. The controller 220 can receive a task execution instruction sent by the host, and the task execution instruction includes an identifier of a computing task to be executed.

[0043] After receiving the task execution instruction, the controller 220 can complete the conversion of the virtual address according to the identifier of the computing task to be executed. The conversion process may include the conversion of the virtual address to the external physical address of the shared storage space and the conversion of the virtual address to the memory address of the first storage space.

[0044] Among them, the conversion of the virtual address to the external physical address of the shared storage space can be carried out in the following manner: according to the identifier of the computing task to be executed, determine the target first address mapping table corresponding to the computing task to be executed in the first address mapping relationship; search the external physical address corresponding to the virtual address carried in the data access instruction in the target first address mapping table.

[0045] The conversion of the virtual address to the memory address of the first storage space can be carried out in the following manner: according to the identifier of the computing task to be executed, determine the target second address mapping table corresponding to the computing task to be executed in the second address mapping relationship; search the memory address corresponding to the virtual address carried in the data access instruction in the target second address mapping table.

[0046] In a specific example, the controller 220 can be loaded with multiple executable computing tasks, and manage the data storage of the computing tasks through the virtual address corresponding to each computing task. When the host needs to call the CXL module to process a computing task, it can send a task execution instruction to the controller 220 based on the CXL.io protocol. The controller 220 can switch the currently executed computing task to the computing task according to the identifier of the computing task to be executed carried in the task execution instruction, and switch the currently used address mapping table to the target first address mapping table and the target second address mapping table corresponding to the identifier. Afterwards, the controller 220 can access the data in the shared storage space according to the target first address mapping table, for example, the processing results can be stored in the shared storage space; it can also access the first storage space according to the target second address mapping table, for example, the intermediate data generated in the process of executing the computing task can be stored in the first storage space.

[0047] In addition, when the controller 220 receives an external access instruction sent by the host, it can access the second storage space and / or the shared storage space according to the external physical address to be accessed carried in the external access instruction.

[0048] In this embodiment, the controller can determine the target first address mapping table and the target second address mapping table corresponding to the task to be executed according to the identifier of the task to be executed, so as to complete the conversion from the virtual address to the external physical address and the memory address. This helps to improve the processing efficiency of the controller in a multi-tasking scenario.

[0049] Reference below Figure 3 , Figure 3 A schematic diagram of an embodiment of a CXL module of the present disclosure is shown. Figure 3 As shown, the memory 310 includes a shared storage space 311, a first storage space 312, and a second storage space 313. The controller 320 is also provided with a cache 321, which is configured to store data in the shared storage space 311; and when the controller 320 accesses data according to an external physical address, it can preferentially access the data in the cache 321 according to the converted external physical address; when there is no data to be accessed in the cache 321, the converted external physical address is translated into a memory address, and the data in the shared storage space 311 is accessed according to the memory address.

[0050] As an example, the controller 320 can load the data in the shared storage space 311 into the cache 321, and record the correspondence between the external physical address of the data and the cache address. When the controller 320 performs a computing task, after converting the virtual address into an external physical address, the external physical address can be searched in the correspondence. If the external physical address exists in the correspondence, the data in the cache 321 is accessed according to the cache address corresponding to the external physical address; if the external physical address does not exist in the correspondence, the external physical address is translated into a memory address, and the data in the shared storage space 311 is accessed according to the memory address.

[0051] In this embodiment, by setting a cache for storing data in the shared storage space and giving priority to accessing the data in the cache, the time taken by the controller to access the data in the shared storage space can be shortened, which helps to improve the efficiency of data access within the CXL module.

[0052] Continue to refer Figure 3 In some optional implementations of the present embodiment, the cache 321 is also configured to store data in the first storage space 312; and, when executing a computing task, the controller 320 may preferentially access the data in the cache 321 according to the converted memory address; when there is no data to be accessed in the cache 321, the data in the first storage space 312 is accessed according to the converted memory address.

[0053] As an example, the controller 320 can load the data in the first storage space 312 into the cache 321, and record the correspondence between the memory address of the data and the cache address. When the controller 320 performs a computing task, after converting the virtual address into a memory address, the memory address can be searched in the correspondence. If the memory address exists in the correspondence, the data in the cache 321 is accessed according to the cache address corresponding to the memory address; if the memory address does not exist in the correspondence, the data in the first storage space 312 is accessed according to the memory address.

[0054] In this embodiment, the data in the first storage space is stored in the cache so that the data in the cache is accessed preferentially, which can shorten the time consumed by the controller to access the data in the first storage space and help to further improve the efficiency of data access within the CXL module.

[0055] In some embodiments, the controller is further configured to: in response to receiving a task end instruction sent by the host, determine the first address mapping table and the second address mapping table corresponding to the task to be ended according to the identifier of the task to be ended carried in the task end instruction; release the storage space occupied by the task to be ended in the shared storage space according to the external physical address in the first address mapping table corresponding to the task to be ended; release the storage space occupied by the task to be ended in the first storage space according to the memory address in the second address mapping table corresponding to the task to be ended; release the storage space occupied by the first address mapping table and the second address mapping table corresponding to the task to be ended.

[0056] In this embodiment, the controller can terminate the corresponding computing task according to the task end instruction sent by the host, and release the resources occupied by the computing task, such as the data stored in the shared storage space and the first storage space by the computing task and the storage resources occupied by the first address mapping table and the second address mapping table corresponding to the computing task, thereby improving the utilization of the memory in the CXL module.

[0057] Reference below Figure 4 , Figure 4 A schematic diagram of an embodiment of a CXL module of the present disclosure is shown. Figure 4 As shown, the memory 410 includes a shared storage space 411, a first storage space 412, and a second storage space 413 that is only accessible to the host. The controller 420 is further configured to: receive an external access instruction sent by the host, the external access instruction carrying an external physical address to be accessed; and access the second storage space 413 and / or the shared storage space 411 according to the external physical address to be accessed.

[0058] In this embodiment, the memory space of the CXL module is divided into a shared storage space, a first storage space, and a second storage space. The permissions and functions of each storage space are different, which helps to improve the memory utilization of the CXL module.

[0059] Continue to refer Figure 4 , the CXL module also includes a flash memory 430; and the controller 420 is further configured to: replace the cold data in the memory 410 with the flash memory 430, and record the correspondence between the external physical address of the cold data and the flash memory address.

[0060] In this embodiment, cold data refers to data with a low access frequency, and the controller may replace the cold data into the flash memory to reduce the storage pressure of the memory.

[0061] Figure 5 A schematic diagram of an embodiment of a controller of the present disclosure is shown, and the controller is applied to the CXL module in any of the above embodiments, such as Figure 5 As shown, the CXL module includes a memory 520 connected to a controller 510, the memory 520 is provided with a shared storage space 521 that allows the controller 510 and the host to access, a first storage space 522 that only allows the controller to access, and a second storage space 523 that only allows the host to access, and the controller 510 includes a processor 511 and a virtual memory manager (Memory Manage Unit, MMU) 512. The virtual memory manager 512 is configured to: convert the virtual address carried in the data access instruction into an external physical address according to a first address mapping relationship from the virtual address to the external physical address corresponding to the shared storage space 521; and convert the virtual address in the data access instruction into a memory address according to a second address mapping relationship from the virtual address to the memory address of the first storage space. The processor 511 is configured to: establish a first address mapping relationship; when executing a computing task, access corresponding data according to the external physical address converted by the virtual memory manager; establish a second address mapping relationship; when executing a computing task, access corresponding data according to the memory address converted by the virtual memory manager; receive an external access instruction sent by the host, the external access instruction carrying the external physical address to be accessed; access the second storage space 523 and / or the shared storage space 521 according to the external physical address to be accessed.

[0062] As an example, the processor 511, as a computing resource of the controller 510, may be one or more CPU cores (i.e., CPU cores) or data processing accelerators, and executes corresponding computing tasks by running application programs. When executing tasks, the processor 511 may generate data access instructions as required, and the data access instructions carry the virtual address corresponding to the data to be accessed. The processor 511 sends the data access instruction to the virtual memory manager 512, and the virtual memory manager 512 may translate the virtual address into an external physical address according to the first address mapping relationship, or translate the virtual address into a memory address according to the second address mapping relationship, so that the processor 511 may access the corresponding data according to the external physical address or the memory address.

[0063] In this embodiment, the part of data can be stored in the first storage space 522. Later, when the controller 510 executes the computing task, it can generate a data access instruction carrying a virtual address according to the demand, and then translate the virtual address into a memory address and use it to access the data in the first storage space 522. For example, the original data of the computing task can be read from the first storage space 522 or the intermediate data generated during the task execution can be stored in the first storage space. In this way, the controller can manage the storage of the original data and intermediate data involved in the computing task in the first storage space based on the virtual address, which can reduce the storage resources occupied by the computing task in the shared storage space and the number of addresses recorded in the first address mapping relationship, thereby reducing the storage resources occupied by the first address mapping relationship in the CXL module and the host; on the other hand, since the first storage space is only accessible to the controller, the second address mapping relationship only needs to be stored in the CXL module and does not need to be stored in the host, thereby further reducing the storage pressure of the host.

[0064] In this embodiment, when the controller 510 receives an external access instruction sent by the host, it can access the second storage space 523 and / or the shared storage space 521 according to the external physical address to be accessed carried in the external access instruction.

[0065] In this embodiment, the memory space of the CXL module is divided into a shared storage space, a first storage space, and a second storage space. The permissions and functions of each storage space are different, which not only helps to improve the memory utilization of the CXL module, but also can realize memory access processing according to the virtual address without going through the host's operating system. On the one hand, it shortens the response time of the CXL module and the host to jointly process tasks, which helps to improve the efficiency and reliability of the CXL module and the host to jointly process tasks; on the other hand, the CXL module replaces the host to realize the conversion of virtual addresses to external physical addresses, which can reduce the load of the host's virtual memory manager. A virtual memory manager is set in the controller to complete the conversion of virtual addresses to external physical addresses or memory addresses inside the controller, which shortens the response time of the CXL module and the host to jointly process tasks, which helps to improve the efficiency and reliability of the CXL module and the host to jointly process tasks.

[0066] In some embodiments, the first address mapping relationship includes a first address mapping table corresponding to each computing task; and the processor is configured to establish a first address mapping relationship, including: receiving a first task assignment instruction sent by the host, the first task assignment instruction including an identifier of the task to be assigned, a first virtual address corresponding to the task to be assigned, and the size of the storage space required for the task to be assigned; according to the first task assignment instruction, determining a storage area corresponding to the task to be assigned in the shared storage space, and determining a first address mapping table between an external physical address of the storage area and the first virtual address; determining a correspondence between the first address mapping table and the identifier of the task to be assigned; and sending the first address mapping table to the host.

[0067] In this embodiment, the processor can process multiple computing tasks and generate a first address mapping table for each computing task according to the first task allocation instruction of the host. Here, the first task allocation instruction is used to instruct the controller to divide the storage area for the task to be assigned in the shared storage space and determine the first address mapping table. The CXL module and the host both store the first address mapping table corresponding to each computing task, so as to access the shared storage space later according to the virtual address and external physical address recorded in the first address mapping table.

[0068] In some embodiments, the second address mapping relationship includes a second address mapping table corresponding to each computing task; and the processor is configured to establish a second address mapping relationship, including: receiving a second task assignment instruction sent by the host, the second task assignment instruction including an identifier of the task to be assigned, a second virtual address corresponding to the task to be assigned, and the size of the storage space required for the task to be assigned; according to the second task assignment instruction, determining a storage area corresponding to the task to be assigned in the first storage space, and determining a second address mapping table between the memory address of the storage area and the second virtual address; determining the correspondence between the second address mapping table and the identifier of the task to be assigned.

[0069] In this embodiment, the processor can generate a second address mapping table for each computing task according to the second task assignment instruction of the host. Here, the second task assignment instruction is used to instruct the processor to divide the storage area for the task to be assigned in the first storage space and determine the second address mapping table. Subsequently, the processor can access the first storage space according to the virtual address and memory address recorded in the second address mapping table corresponding to each computing task. In this way, each computing task can correspond to a first address mapping table and a second address mapping table at the same time, which is convenient for the processor to manage the execution process of the computing task and the data storage of the processing result according to the virtual address.

[0070] In some embodiments, the processor is further configured to: receive a task execution instruction sent by the host, the task execution instruction including an identifier of a computing task to be executed; determine a target first address mapping table corresponding to the computing task to be executed in a first address mapping relationship according to the identifier of the computing task to be executed, and determine a target second address mapping table corresponding to the computing task to be executed in a second address mapping relationship; the virtual memory manager is configured to convert the virtual address carried in the data access instruction into an external physical address according to a first address mapping relationship from the virtual address to the external physical address corresponding to the shared storage space, including: searching the target first address mapping table for the external physical address corresponding to the virtual address carried in the data access instruction; the virtual memory manager is configured to convert the virtual address carried in the data access instruction into a memory address according to the second address mapping relationship, including: searching the target second address mapping table for the memory address corresponding to the virtual address carried in the data access instruction.

[0071] In this embodiment, the processor can determine the target first address mapping table and the target second address mapping table corresponding to the task to be executed according to the identifier of the task to be executed, and then the virtual memory manager completes the conversion from the virtual address to the external physical address and the memory address. This helps to improve the processing efficiency of the controller in a multi-tasking scenario.

[0072] like Figure 6As shown, the controller includes a cache 610, an address translator 620, a processor 630, and a virtual memory manager 640.

[0073] The controller is also provided with a cache 610 and an address translator 620, wherein the cache 610 is configured to store data in a shared storage space; the address translator 620 is configured to translate an external physical address into a memory address; and the processor 630 can preferentially access the data in the cache according to the external physical address converted by the virtual memory manager 640; when there is no data to be accessed in the cache 610, the converted external physical address is sent to the address translator 620, and the data in the shared storage space is accessed according to the memory address translated by the address translator 620.

[0074] In this embodiment, the address translator 620 is used to translate the external physical address into the memory address. Usually, the address carried in the external access instruction sent by the host to the CXL module based on the CXL.mem protocol or the CXL.cache protocol is the external physical address, and the controller can use the address translator 620 to translate the external physical address into the memory address to complete the host's memory access operation. Here, the address translator 620 can also translate the external physical address output by the virtual memory manager 640 into the memory address to complete the memory access operation when the processor 630 performs a computing task.

[0075] In this embodiment, by setting a cache for storing data in the shared storage space and giving priority to accessing the data in the cache, the time taken by the processor to access the data in the shared storage space can be shortened, which helps to improve the efficiency of data access within the CXL module.

[0076] Continue to refer Figure 6 In some optional implementations of the present embodiment, the cache 610 is also configured to store data in the first storage space; and the processor 630 can preferentially access the data in the cache 610 according to the memory address converted by the virtual memory manager 640; when there is no data to be accessed in the cache 610, the data in the first storage space is accessed according to the converted memory address.

[0077] In this embodiment, the data in the first storage space is stored in the cache so as to give priority to accessing the data in the cache, which can shorten the time taken by the processor to access the data in the first storage space and help to further improve the efficiency of data access within the CXL module.

[0078] In some embodiments, the processor is further configured to: in response to receiving a task end instruction sent by the host, determine the first address mapping table and the second address mapping table corresponding to the task to be ended according to the identifier of the task to be ended carried in the task end instruction; release the storage space occupied by the task to be ended in the shared storage space according to the external physical address in the first address mapping table corresponding to the task to be ended; release the storage space occupied by the task to be ended in the first storage space according to the memory address in the second address mapping table corresponding to the task to be ended; release the storage space occupied by the first address mapping table and the second address mapping table corresponding to the task to be ended.

[0079] In this embodiment, the processor can terminate the corresponding computing task according to the task end instruction sent by the host, and release the resources occupied by the computing task, such as the data stored in the shared storage space and the first storage space by the computing task and the storage resources occupied by the first address mapping table and the second address mapping table corresponding to the computing task, so as to improve the utilization rate of the memory in the CXL module.

[0080] In some embodiments, the CXL module further includes a flash memory; and the processor is further configured to: replace the cold data in the memory with the flash memory, and record the correspondence between the external physical address of the cold data and the flash memory address.

[0081] In this embodiment, cold data refers to data with a low access frequency, and the controller may replace the cold data into the flash memory to reduce the storage pressure of the memory.

[0082] The present disclosure also provides a task processing method, which is applied to the CXL module in any of the above embodiments. The CXL module includes a controller and a memory connected to the controller. The memory is provided with a shared storage space that allows the controller and the host to access, a first storage space that only allows the controller to access, and a second storage space that only allows the host to access. Figure 7 As shown, the method includes the following steps.

[0083] Step 710: Establish a first address mapping relationship between a virtual address and an external physical address corresponding to a shared storage space and a second address mapping relationship between a virtual address and a memory address of a first storage space.

[0084] Step 720: When executing a computing task, convert the virtual address carried in the data access instruction into an external physical address according to the first address mapping relationship, and access the corresponding data according to the external physical address obtained by the conversion.

[0085] Step 730: Convert the virtual address carried in the data access instruction into a memory address according to the second address mapping relationship, and access the corresponding data according to the converted memory address.

[0086] Step 740: Receive an external access instruction sent by the host.

[0087] The external access instruction carries the external physical address to be accessed.

[0088] Step 750: Access the second storage space and / or the shared storage space according to the external physical address to be accessed.

[0089] In this embodiment, a first address mapping relationship between a virtual address and an external physical address corresponding to a shared storage space and a second address mapping relationship between a virtual address and a memory address of the first storage space can be established, so that when executing a computing task, the virtual address carried in the data access instruction can be converted into an external physical address according to the first address mapping relationship, and the virtual address carried in the data access instruction can be converted into a memory address according to the second address mapping relationship, and the corresponding data can be accessed according to the converted external physical address and memory address; the second storage space and / or the shared storage space can also be accessed according to the external physical address to be accessed carried in the external access instruction. Not only is the utilization rate of the storage space of the CXL module improved, but also the memory access processing according to the virtual address can be realized without the operating system of the host. On the one hand, the response time of the CXL module and the host co-processing tasks is shortened, which helps to improve the efficiency and reliability of the CXL module and the host co-processing tasks; on the other hand, the CXL module replaces the host to realize the conversion of the virtual address to the external physical address, which can reduce the load of the virtual memory manager of the host.

[0090] Reference below Figure 8 , Figure 8 FIG. 1 is a flow chart showing a process of establishing a first address mapping relationship in an embodiment of the task processing method disclosed in the present invention. Figure 8 As shown, the process includes the following steps.

[0091] Step 810: Receive a first task allocation instruction sent by a host.

[0092] The first task allocation instruction includes an identifier of the task to be allocated, a first virtual address corresponding to the task to be allocated, and a size of a storage space required by the task to be allocated.

[0093] Step 820: According to the first task allocation instruction, determine the storage area corresponding to the task to be allocated in the shared storage space, and determine a first address mapping table between the external physical address of the storage area and the first virtual address.

[0094] Step 830: Determine the correspondence between the first address mapping table and the identifier of the task to be assigned.

[0095] Step 840: Send the first address mapping table to the host.

[0096] In this embodiment, the controller of the CXL module can process multiple computing tasks, and the first address mapping relationship includes a first address mapping table corresponding to each computing task. Figure 8 The process shown can generate a first address mapping table for each computing task according to the first task allocation instruction of the host. Here, the first task allocation instruction is used to instruct the controller to divide the storage area for the task to be assigned in the shared storage space and determine the first address mapping table. The CXL module and the host both store the first address mapping table corresponding to each computing task, so as to access the shared storage space later according to the virtual address and external physical address recorded in the first address mapping table.

[0097] Reference below Fig. 9 , Fig. 9 FIG. 1 is a flow chart showing a process of establishing a second address mapping relationship in an embodiment of the task processing method disclosed in the present invention. Fig. 9 As shown, the process includes the following steps.

[0098] Step 910: Receive a second task allocation instruction sent by the host.

[0099] The second task allocation instruction includes an identifier of the task to be allocated, a second virtual address corresponding to the task to be allocated, and a size of a storage space required by the task to be allocated.

[0100] Step 920: According to the second task allocation instruction, determine in the first storage space a storage area corresponding to the task to be allocated, and determine a second address mapping table between the memory address of the storage area and the second virtual address.

[0101] Step 930: Determine the correspondence between the second address mapping table and the identifier of the task to be assigned.

[0102] In this embodiment, the second address mapping relationship includes a second address mapping table corresponding to each computing task. Fig. 9 According to the process shown, the controller can generate a second address mapping table for each computing task according to the second task allocation instruction of the host. Here, the second task allocation instruction is used to instruct the controller to divide the storage area for the task to be assigned in the first storage space and determine the second address mapping table. Subsequently, the controller can access the first storage space according to the virtual address and memory address recorded in the second address mapping table corresponding to each computing task.

[0103] Combination Figure 8 In the process shown, each computing task can correspond to a first address mapping table and a second address mapping table at the same time, so that the controller can manage the execution process of the computing task and the data storage of the processing result according to the virtual address.

[0104] Reference below Fig.10 , Fig.10 A flowchart of another embodiment of the task processing method disclosed in the present invention is shown as follows: Fig.10 As shown, the process includes the following steps.

[0105] Step 1010: Receive a task execution instruction sent by the host.

[0106] The task execution instruction includes an identification of a computing task to be executed.

[0107] Step 1020: According to the identifier of the computing task to be executed, determine the target first address mapping table corresponding to the computing task to be executed in the first address mapping relationship, and determine the target second address mapping table corresponding to the computing task to be executed in the second address mapping relationship.

[0108] Step 1030: Search the target first address mapping table for the external physical address corresponding to the virtual address carried in the data access instruction.

[0109] Step 1040: Search the target second address mapping table for the memory address corresponding to the virtual address carried in the data access instruction.

[0110] Step 1050: Access corresponding data according to the external physical address and memory address obtained by the search.

[0111] In this embodiment, the target first address mapping table and the target second address mapping table corresponding to the task to be executed can be determined according to the identifier of the task to be executed, so as to complete the conversion from the virtual address to the external physical address and the memory address, which helps to improve the processing efficiency of the controller in a multi-tasking scenario.

[0112] In some embodiments, the controller is also provided with a cache, which is configured to store data in a shared storage space; and the above step 720 may include: according to the external physical address obtained by conversion, giving priority to accessing the data in the cache; when there is no data to be accessed in the cache, translating the converted external physical address into a memory address, and accessing the data in the shared storage space according to the memory address.

[0113] In this embodiment, by setting a cache for storing data in the shared storage space and giving priority to accessing the data in the cache, the time taken by the controller to access the data in the shared storage space can be shortened, which helps to improve the efficiency of data access within the CXL module.

[0114] In some embodiments, the cache is also configured to store data in the first storage space; and the above step 730 may include: preferentially accessing the data in the cache according to the memory address obtained by conversion; and when there is no data to be accessed in the cache, accessing the data in the first storage space according to the memory address obtained by conversion.

[0115] In this embodiment, the data in the first storage space is stored in the cache so that the data in the cache is accessed preferentially, which can shorten the time consumed by the controller to access the data in the first storage space and help to further improve the efficiency of data access within the CXL module.

[0116] Reference below Fig.11 , Fig.11 A schematic diagram of a process of terminating a task in an embodiment of the task processing method disclosed in the present invention is shown. Fig.11 As shown, the process includes the following steps.

[0117] Step 1110: In response to receiving a task end instruction sent by the host, determine a first address mapping table and a second address mapping table corresponding to the task to be ended according to an identifier of the task to be ended carried in the task end instruction.

[0118] Step 1120: Release the storage space occupied by the task to be terminated in the shared storage space according to the external physical address in the first address mapping table corresponding to the task to be terminated.

[0119] Step 1130: Release the storage space occupied by the task to be ended in the first storage space according to the memory address in the second address mapping table corresponding to the task to be ended.

[0120] Step 1140: Release the storage space occupied by the first address mapping table and the second address mapping table corresponding to the task to be terminated.

[0121] In this embodiment, the corresponding computing task can be terminated according to the task end instruction sent by the host, and the resources occupied by the computing task can be released, such as the data stored in the shared storage space and the first storage space by the computing task and the storage resources occupied by the first address mapping table and the second address mapping table corresponding to the computing task, thereby improving the memory utilization in the CXL module.

[0122] The embodiments of the present disclosure further provide a non-transitory computer storage medium, which stores a computer program. When the computer program is executed by a processor, the task processing method in the above embodiments is implemented.

[0123] The present disclosure also provides a computer system, such as Fig.12As shown, the computer system includes a host 1210 and a CXL module 1220 in any of the above embodiments. The host 1210 communicates with the CXL module 1220 via a CXL interface to achieve discovery, configuration and data transmission of the CXL module 1220 .

[0124] In this embodiment, the CXL module 1220 can manage the storage of data involved in the computing task in the memory according to the virtual address. When coordinating the host 1210 to jointly execute the budget task, the CXL module 1220 can complete the virtual address conversion process internally. On the one hand, it avoids the conversion of virtual addresses through the host's operating system and can shorten the task response time. On the other hand, the data storage of multiple tasks in the CXL module is managed based on the virtual address, which can avoid the mutual trampling of storage resources of multiple tasks.

[0125] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

Claims

1. A CXL module, comprising a controller and a memory connected to the controller, characterized in that: The memory is provided with a shared storage space that allows the controller and the host to access, a first storage space that only allows the controller to access, and a second storage space that only allows the host to access; The controller is configured to: establish a first address mapping relationship from a virtual address to an external physical address corresponding to the shared storage space; When executing a computing task, converting the virtual address carried in the data access instruction into an external physical address according to the first address mapping relationship, and accessing corresponding data according to the external physical address obtained by the conversion; Establishing a second address mapping relationship from a virtual address to a memory address of the first storage space; When executing a computing task, converting the virtual address carried in the data access instruction into a memory address according to the second address mapping relationship, and accessing corresponding data according to the converted memory address; An external access instruction sent by the host is received, wherein the external access instruction carries an external physical address to be accessed; and the second storage space and / or the shared storage space is accessed according to the external physical address to be accessed.

2. The CXL module according to claim 1, characterized in that: The first address mapping relationship includes a first address mapping table corresponding to each computing task; and The controller is configured to establish a first address mapping relationship from a virtual address to an external physical address corresponding to the shared storage space, including: receiving a first task assignment instruction sent by a host, the first task assignment instruction including an identifier of the task to be assigned, a first virtual address corresponding to the task to be assigned, and a size of the storage space required for the task to be assigned; according to the first task assignment instruction, determining a storage area corresponding to the task to be assigned in the shared storage space, and determining a first address mapping table between the external physical address of the storage area and the first virtual address; determining a correspondence between the first address mapping table and the identifier of the task to be assigned; and sending the first address mapping table to the host.

3. The CXL module according to claim 2, characterized in that: The second address mapping relationship includes a second address mapping table corresponding to each computing task; and The controller is configured to establish a second address mapping relationship from a virtual address to a memory address of the first storage space, including: receiving a second task assignment instruction sent by a host, the second task assignment instruction including an identifier of the task to be assigned, a second virtual address corresponding to the task to be assigned, and a size of the storage space required for the task to be assigned; according to the second task assignment instruction, determining a storage area corresponding to the task to be assigned in the first storage space, and determining a second address mapping table between the memory address of the storage area and the second virtual address; and determining a correspondence between the second address mapping table and the identifier of the task to be assigned.

4. The CXL module according to claim 3, characterized in that: The controller is further configured to: receive a task execution instruction sent by a host, wherein the task execution instruction includes an identifier of a computing task to be executed; The controller is configured to convert the virtual address carried in the data access instruction into an external physical address according to the first address mapping relationship when executing the computing task, including: determining a target first address mapping table corresponding to the computing task to be executed in the first address mapping relationship according to the identifier of the computing task to be executed; searching the external physical address corresponding to the virtual address carried in the data access instruction in the target first address mapping table; The controller is configured to convert the virtual address carried in the data access instruction into a memory address according to the second address mapping relationship when executing a computing task, including: determining a target second address mapping table corresponding to the computing task to be executed in the second address mapping relationship according to the identifier of the computing task to be executed; and searching the memory address corresponding to the virtual address carried in the data access instruction in the target second address mapping table.

5. The CXL module according to claim 4, characterized in that: The controller is also provided with a cache, which is configured to store the data in the shared storage space; as well as, The controller is configured to access corresponding data according to the converted external physical address, including: preferentially accessing the data in the cache according to the converted external physical address; In the case that the data to be accessed does not exist in the cache, the external physical address obtained by the conversion is translated into a memory address, and the data in the shared storage space is accessed according to the memory address.

6. The CXL module according to claim 5, characterized in that: The cache is also configured to store data in the first storage space; as well as, The controller is configured to access corresponding data according to the converted memory address, including: preferentially accessing the data in the cache according to the converted memory address; When there is no data to be accessed in the cache, the data in the first storage space is accessed according to the memory address obtained by the conversion.

7. The CXL module according to claim 3, characterized in that: The controller is further configured to: in response to receiving a task end instruction sent by the host, determine a first address mapping table and a second address mapping table corresponding to the task to be ended according to an identifier of the task to be ended carried in the task end instruction; and release the storage space occupied by the task to be ended in the shared storage space according to the external physical address in the first address mapping table corresponding to the task to be ended; According to the memory address in the second address mapping table corresponding to the task to be ended, releasing the storage space occupied by the task to be ended in the first storage space; The storage space occupied by the first address mapping table and the second address mapping table corresponding to the task to be ended is released.

8. The CXL module according to any one of claims 1 to 7, characterized in that: The CXL module further includes a flash memory; and the controller is further configured to: replace the cold data in the memory with the flash memory, and record the correspondence between the external physical address of the cold data and the flash memory address.

9. A controller, applied to the CXL module according to any one of claims 1 to 8, the CXL module comprising a memory connected to the controller, the memory being provided with a shared storage space accessible by the controller and a host, a first storage space accessible only by the controller, and a second storage space accessible only by the host, wherein: The controller includes a processor and a virtual memory manager; wherein, The virtual memory manager is configured to: convert the virtual address carried in the data access instruction into an external physical address according to a first address mapping relationship between the virtual address and the external physical address corresponding to the shared storage space; convert the virtual address in the data access instruction into a memory address according to a second address mapping relationship between the virtual address and the memory address of the first storage space; The processor is configured to: establish the first address mapping relationship; when executing a computing task, access the corresponding data according to the external physical address converted by the virtual memory manager; establish the second address mapping relationship; when executing a computing task, access the corresponding data according to the memory address converted by the virtual memory manager; receive an external access instruction sent by the host, the external access instruction carrying the external physical address to be accessed; access the second storage space and / or the shared storage space according to the external physical address to be accessed.

10. The controller according to claim 9, characterized in that: The first address mapping relationship includes a first address mapping table corresponding to each computing task; and The processor is configured to establish the first address mapping relationship, including: receiving a first task assignment instruction sent by a host, the first task assignment instruction including an identifier of the task to be assigned, a first virtual address corresponding to the task to be assigned, and a size of the storage space required for the task to be assigned; according to the first task assignment instruction, determining a storage area corresponding to the task to be assigned in the shared storage space, and determining a first address mapping table between an external physical address of the storage area and the first virtual address; determining a correspondence between the first address mapping table and the identifier of the task to be assigned; and sending the first address mapping table to the host.

11. The controller according to claim 10, characterized in that: The second address mapping relationship includes a second address mapping table corresponding to each computing task; and The processor is configured to establish the second address mapping relationship, including: receiving a second task assignment instruction sent by the host, the second task assignment instruction including an identifier of the task to be assigned, a second virtual address corresponding to the task to be assigned, and a size of the storage space required for the task to be assigned; according to the second task assignment instruction, determining a storage area corresponding to the task to be assigned in the first storage space, and determining a second address mapping table between the memory address of the storage area and the second virtual address; determining a correspondence between the second address mapping table and the identifier of the task to be assigned.

12. The controller according to claim 11, characterized in that: The processor is further configured to: receive a task execution instruction sent by a host, the task execution instruction including an identifier of a computing task to be executed; determine a target first address mapping table corresponding to the computing task to be executed in the first address mapping relationship according to the identifier of the computing task to be executed, and determine a target second address mapping table corresponding to the computing task to be executed in the second address mapping relationship; The virtual memory manager is configured to convert the virtual address carried in the data access instruction into the external physical address according to the first address mapping relationship from the virtual address to the external physical address corresponding to the shared storage space, including: searching the external physical address corresponding to the virtual address carried in the data access instruction in the target first address mapping table; The virtual memory manager is configured to convert the virtual address carried in the data access instruction into a memory address according to the second address mapping relationship, including: searching the memory address corresponding to the virtual address carried in the data access instruction in the target second address mapping table.

13. The controller according to claim 12, characterized in that: The controller is further provided with a cache and an address translator, wherein the cache is configured to store data in the shared storage space; the address translator is configured to translate an external physical address into a memory address; as well as, The processor is configured to access corresponding data according to the external physical address obtained by conversion by the virtual memory manager, including: according to the external physical address obtained by conversion, preferentially accessing the data in the cache; In the case that the data to be accessed does not exist in the cache, the external physical address obtained by the conversion is sent to the address translator, and the data in the shared storage space is accessed according to the memory address obtained by the translation of the address translator.

14. The controller according to claim 13, characterized in that: The cache is also configured to store data in the first storage space; as well as, The processor is configured to access corresponding data according to the memory address converted by the virtual memory manager, including: preferentially accessing the data in the cache according to the memory address converted; When there is no data to be accessed in the cache, the data in the first storage space is accessed according to the memory address obtained by the conversion.

15. The controller according to claim 11, characterized in that: The processor is further configured to: in response to receiving a task end instruction sent by the host, determine a first address mapping table and a second address mapping table corresponding to the task to be ended according to an identifier of the task to be ended carried in the task end instruction; and release the storage space occupied by the task to be ended in the shared storage space according to the external physical address in the first address mapping table corresponding to the task to be ended; According to the memory address in the second address mapping table corresponding to the task to be ended, releasing the storage space occupied by the task to be ended in the first storage space; The storage space occupied by the first address mapping table and the second address mapping table corresponding to the task to be ended is released.

16. The controller according to any one of claims 9 to 15, characterized in that: The CXL module further includes a flash memory; and the processor is further configured to: replace the cold data in the memory with the flash memory, and record the correspondence between the external physical address of the cold data and the flash memory address.

17. A task processing method, applied to the CXL module according to any one of claims 1 to 8, wherein the CXL module comprises a controller and a memory connected to the controller, wherein the memory is provided with a shared storage space accessible to the controller and a host, a first storage space accessible only to the controller, and a second storage space accessible only to the host, wherein: The method comprises: Establishing a first address mapping relationship between a virtual address and an external physical address corresponding to the shared storage space and a second address mapping relationship between a virtual address and a memory address of the first storage space; When executing a computing task, converting the virtual address carried in the data access instruction into an external physical address according to the first address mapping relationship, and accessing the corresponding data according to the converted external physical address; converting the virtual address carried in the data access instruction into a memory address according to the second address mapping relationship, and accessing the corresponding data according to the converted memory address; and, Receiving an external access instruction sent by the host, wherein the external access instruction carries an external physical address to be accessed; The second storage space and / or the shared storage space is accessed according to the external physical address to be accessed.

18. The method according to claim 17, characterized in that The first address mapping relationship includes a first address mapping table corresponding to each computing task; and Establishing a first address mapping relationship from a virtual address to an external physical address corresponding to the shared storage space includes: receiving a first task assignment instruction sent by a host, the first task assignment instruction including an identifier of the task to be assigned, a first virtual address corresponding to the task to be assigned, and a size of the storage space required for the task to be assigned; determining, according to the first task assignment instruction, a storage area corresponding to the task to be assigned in the shared storage space, and determining a first address mapping table between the external physical address of the storage area and the first virtual address; determining a correspondence between the first address mapping table and the identifier of the task to be assigned; and sending the first address mapping table to the host.

19. The method according to claim 18, characterized in that The second address mapping relationship includes a second address mapping table corresponding to each computing task; and Establishing a second address mapping relationship from a virtual address to a memory address of the first storage space includes: receiving a second task assignment instruction sent by a host, the second task assignment instruction including an identifier of the task to be assigned, a second virtual address corresponding to the task to be assigned, and a size of the storage space required for the task to be assigned; determining, according to the second task assignment instruction, a storage area corresponding to the task to be assigned in the first storage space, and determining a second address mapping table between the memory address of the storage area and the second virtual address; and determining a correspondence between the second address mapping table and the identifier of the task to be assigned.

20. The method according to claim 19, characterized in that Before executing the computing task, the method further includes: receiving a task execution instruction sent by a host, the task execution instruction including an identifier of the computing task to be executed; determining a target first address mapping table corresponding to the computing task to be executed in the first address mapping relationship according to the identifier of the computing task to be executed, and determining a target second address mapping table corresponding to the computing task to be executed in the second address mapping relationship; When executing a computing task, converting the virtual address carried in the data access instruction into an external physical address according to the first address mapping relationship includes: searching the target first address mapping table for an external physical address corresponding to the virtual address carried in the data access instruction; When executing a computing task, converting the virtual address carried in the data access instruction into a memory address according to the second address mapping relationship includes: searching the target second address mapping table for a memory address corresponding to the virtual address carried in the data access instruction.

21. The method according to claim 20, characterized in that The controller is also provided with a cache, which is configured to store the data in the shared storage space; as well as, Accessing corresponding data according to the external physical address obtained by conversion includes: preferentially accessing the data in the cache according to the external physical address obtained by conversion; In the case that the data to be accessed does not exist in the cache, the external physical address obtained by the conversion is translated into a memory address, and the data in the shared storage space is accessed according to the memory address.

22. The method according to claim 21, characterized in that The cache is also configured to store data in the first storage space; as well as, Accessing corresponding data according to the memory address obtained by the conversion includes: preferentially accessing the data in the cache according to the memory address obtained by the conversion; When there is no data to be accessed in the cache, the data in the first storage space is accessed according to the memory address obtained by the conversion.

23. The method according to any one of claims 19 to 22, characterized in that The method also includes: in response to receiving a task end instruction sent by the host, determining a first address mapping table and a second address mapping table corresponding to the task to be ended according to an identifier of the task to be ended carried in the task end instruction; releasing the storage space occupied by the task to be ended in the shared storage space according to an external physical address in the first address mapping table corresponding to the task to be ended; releasing the storage space occupied by the task to be ended in the first storage space according to a memory address in the second address mapping table corresponding to the task to be ended; and releasing the storage space occupied by the first address mapping table and the second address mapping table corresponding to the task to be ended.

24. A non-transitory computer storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the task processing method according to any one of claims 17 to 23 is implemented.

25. A computer system, characterized in that: The system comprises a host and the CXL module according to any one of claims 1 to 8, wherein the host communicates with the CXL module via a CXL interface to achieve discovery, configuration and data transmission of the CXL module.

Citation Information

Patent Citations

  • CXL memory module, control chip, data processing method, medium and system

    CN117632043A

  • CXL module, controller, task processing method, medium and system

    CN117785758A